Page 1 of 1

FRESH PONG__LUA HELP

Posted: Wed Oct 14, 2009 9:05 pm
by Angrycrow
I'm working on a fresh version of pong. I've been working with love/lua for a couple of months but every once in a while I hit a pretty strong snag.

Anyway. Fresh pong.

I need help managing transitions. The pong game is simple. But I have a 'titleScreen' effect and a fadeTo(nextState) effect. It's supposed to fade to black and change the state variable.

Right now my problem is making the transitions reliable.

I update effects the same way that I change the game state.

Code: Select all

--in main 
function update(dt)
    state:update(dt) -- different menu / game states
    effect:update(dt) -- transitions and effects/text objects
end

--When I want to change the state / effect I do something like:

effect = fadeTo(Menu()) ---<<< is this correct? 

-- Is passing in  Menu() different from just setting :

state = Menu()
I've been trying to fix the transition bug for about a week now. I'm pretty stumped.
This is the current project file:

http://dl.getdropbox.com/u/1710407/ACP_006_101009.love

please help!

- thank you.