Countdown timer doesn´t stop at zero

FamTechAdminFamTechAdmin Member Posts: 47
edited May 2015 in Working with GS (Mac)

Hi.

I'm have a countdown timer that starts at 05:00 and should stop at 00:00. I created the timer with the help of two tutorials that I found on YouTube...
...But I encountered two minor issues that I don´t know how to solve.

First, you hardly see 05:00 when the timer starts. you see it for a millisecond before it goes to 04:59. Is there a way to "delay" it so that you can actually see the 05:00, before it starts the countdown?

Second, the logic below should stop at 00:00, according to one of the tutorials but when I preview it, it just goes past 00:00 and stops instead at 59:59.

Attributes
StartTime 0 real
MyTimer 0 real

Display Text
* floor(floor(( game.MyTimer %3600)/60)/10)..floor((floor( game.MyTimer %3600)/60)%10)..":"..floor(( game.MyTimer %60)/10)..floor( game.MyTimer %10)

Change Attribute
* game.StartTime to game.Time

Rule
* When all conditions are valid, game.MyTimer to > 0
* Constrain Attribut_e
* _game.MyTimer to 300-( game.Time - game.StartTime )

Sign In or Register to comment.