TIMER

Ashwin goel
Posts
1
Karma
1
Ashwin goel posted this 29 July 2017

Suppose when i start the game timer starts. But when fish touch water than time should be stopped.

 

I can make timer start but how can I stop it (pause). 

 

Regards

ASHWIN

-1
Stephen Coy
Posts
167
Karma
213
Admin
Stephen Coy posted this 31 July 2017

Hi Ashwin,

 

There's no way to stop a timer but you can probably combine timers and scores to get the effect you want.  For instance, let's say I want to have a 60 second time limit for the game but I don't want the time to include time when I'm touching water.  I could program this:

 

1) WHEN Timer 1Second DO

2)       WHEN TouchWater Not DO Score+ Red 1Point

3) WHEN Scored Red >= 60 DO GameOver

 

In this example, the first line just triggers every second.  This means that line 2 is only evaluated once per second.  It looks to see if the character is touching water, if not a point is added to the red score.

Finally, the third line checks for the Red score getting to 60.  This means that there have been 60 seconds of not touching water.

 

Hoepefully this can be made to work for your game.

 

1