Animating Effects/Transitions

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Angrycrow
Prole
Posts: 29
Joined: Fri Mar 06, 2009 8:16 pm
Location: Los Angeles
Contact:

Re: Animating Effects/Transitions

Post by Angrycrow » Sun Oct 11, 2009 6:37 am

Yes! it was the dt variable after all.

I've been using rough numbers to get the feel that I want for the different effect timing.

Speaking of Effects/Transitions. I have a few working! There is a title screen and an exit screen and the fadeTo(nextState) transition almost works perfectly.

Actually I need a little help/ clarification on updating the state and passing functions as args. When you click into a menu the state appears to change ( the BG art and buttons move). But when you try and click back the buttons are initialized but the state variable doesn't seem to update correctly. I had it working earlier but some small thing broke it.

How can I be sure that when I do something like...

Code: Select all

{ 
-- when a button is pressed to go to the next screen I used to:
//state = Menu() -- works fine. 
-- now I want to do something like this:
effect = fadeTo(OptionMenu()) -- inside fadeTo I say state = newState when the screen is all Black. 
}
...that the function that I'm sending in changes the state:update() to OptionMenu() rather than just running the init function once?

Aside from dealing with this I'm starting to clean up the structure, I need help with eliminating global variables ( if there is a real need to, I understand that it's efficient i just am not clear on where it's appropriate).

This project get's more interesting every day. I'm having a lot of fun with love! Please take a look at my project and let me know if there is anything that I'm doing wrong. Or if I could structure things better to make things faster.
I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, It's a way of looking at life through the wrong end of a telescope. Which is what I do, And that enables you to laugh at life's realities.
- Dr. Seuss

User avatar
Angrycrow
Prole
Posts: 29
Joined: Fri Mar 06, 2009 8:16 pm
Location: Los Angeles
Contact:

Re: Animating Effects/Transitions

Post by Angrycrow » Sun Oct 11, 2009 7:00 am

and I don't know what's up with the upload system but here's a link to the file.

http://dl.getdropbox.com/u/1710407/ACP_006_101009.love
I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, It's a way of looking at life through the wrong end of a telescope. Which is what I do, And that enables you to laugh at life's realities.
- Dr. Seuss

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests