Hi. I made a quiz game .
When you start the game, you go at menu.lua.
After you click on Play! text, you go on game.lua where the important code is.
When maxLives == 0, you go to endgame.
If you click at the rectangle in the endgame, you go on main menu.
The problem is the transition between endgame and menu.
My game.lua is like this:
1 timer(countdown from 20 to 0) that is reseting many times, 1 question and 4 answers.
So what is the problem?
After I got 0 maxLives - the scene is switching to endgame.
BUT, I can’t go to menu until the timer reach again 0 (that means 20 seconds). In that time, the switching isn’t possible.
I need to wait 20 times to switch the scenes.
Here is my code. http://pastebin.com/E6PuNc6g
I tried to put timer.cancel(timerID) in hasHealth function, I can’t switch from endgame to menu. (Even if I wait 20 seconds).
I tried to solve this in vain. It took me 5-6 hours and I couldn’t get it done.
Thank you.
[import]uid: 178587 topic_id: 32020 reply_id: 332020[/import]