Jump to content

Issue with timer


carlosguerrera

Recommended Posts

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.

Link to comment

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.

post-2245765-058645500 1417883670_thumb.jpg

Link to comment

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:

if-else.JPG

 

Here's what the On Elapse Event looks like:

onElapse.JPG

 

I could send you the Urwigo file if you'd care to look at it.

 

Thanks again.

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...