+carlosguerrera Posted December 6, 2014 Share Posted December 6, 2014 Hi, I'm having trouble with the timer on my trivia type Wherigo. The player has 2 minutes to answer 15 questions correctly before the timer runs out. If the player is able to answer the 15 questions correctly, the timer stops and the player is taken to back to main menu. There they can choose to see the score, see the rules of the game, play again, exit the game, etc... If the timer runs out, the On elapse event kicks in and the player receives a message saying that time has run out and is given an option to play again or be taken back to the main menu. The trouble I'm having is that the On elapse event kicks in when the player relaunches the cartridge and chooses to resume it, even though the questions were answered before time ran out. I only have On elapse event setup on my timer and I use Urwigo to create cartridges. Any help would be appreciated. Thanks in advance. Quote Link to comment
+charlenni Posted December 6, 2014 Share Posted December 6, 2014 Could it be, that you try to stop the timer in the OnTick event? That normally don't work. If this is the case, you could set a flag, which you check at the beginning of the OnTick event and don't do anything, if the OnTick has run before. Quote Link to comment
+carlosguerrera Posted December 6, 2014 Author Share Posted December 6, 2014 Could it be, that you try to stop the timer in the OnTick event? That normally don't work. If this is the case, you could set a flag, which you check at the beginning of the OnTick event and don't do anything, if the OnTick has run before. Thanks for the quick reply. I'm new at this and I'm not sure where to find the OnTick event. I don't recall ever seeing it in Urwigo. I'm stopping the timer with a "Stop timer action". It's within if/else in a function. If the variable Right Answer = 15 the it triggers the "Stop timer action", else it asks another question. Quote Link to comment
+charlenni Posted December 6, 2014 Share Posted December 6, 2014 I assume, that it is the same as your on elapse event. Do you stop the timer in this event? Btw. the screenshot didn't worked for me. Quote Link to comment
+carlosguerrera Posted December 6, 2014 Author Share Posted December 6, 2014 I assume, that it is the same as your on elapse event. Do you stop the timer in this event? Btw. the screenshot didn't worked for me. I'm not sure what happened with the attachment. It showed ok on preview. Here it is again: Here's what the On Elapse Event looks like: I could send you the Urwigo file if you'd care to look at it. Thanks again. Quote Link to comment
+carlosguerrera Posted December 6, 2014 Author Share Posted December 6, 2014 I figured it out. I put a Stop timer Action in the On resume Event. That took care of it. I still don't understand why I need that in there when I stopped the timer before. Anyone? Quote Link to comment
+charlenni Posted December 6, 2014 Share Posted December 6, 2014 Ok, I belive, that you stop the timer in "Game Reset" or in "Main Menu". If you do this, the timer don't stop and, because of this, is running, even if you are save/resume the cartridge. To avoid this, set a flag like "StopTimer" in "On elapse" to "true" and in "On start" of the timer check this flag. Use a if/then construct and check, if "StopTimer" is "true". If correct, than stop the timer and set "StopTimer" to "false" (for the next time). That should do the trick. If you have problems, than send me the Urwigo file at info (at) wfplayer (dot) com. Quote Link to comment
+charlenni Posted December 6, 2014 Share Posted December 6, 2014 You stopped the timer inside the "On elapse" event. This is a problem, because it doesn't work. You could say, it is a bug. Quote Link to comment
+carlosguerrera Posted December 6, 2014 Author Share Posted December 6, 2014 You stopped the timer inside the "On elapse" event. This is a problem, because it doesn't work. You could say, it is a bug. I will try your suggestions. Thanks for your help. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.