You can't have the timer count down. Make a timer variable and every 0.01 seconds change it by -0.01.
Offline
when gf clicked forever change [time left v] by [-0.01] wait [0.01] secs if <(time left) = [0]> broadcast [start game v] endThis should work.
Last edited by sonicfan12p (2012-05-20 16:01:20)
Offline
al33th3a wrote:
I need to set my game timer to count down, when it gets to 0:00 it should start over at the beginning if the game isn't completed with in time allowed.
Thanks in advance ,
Al33th3a
Hey there Al33th3a!
As previously stated by sonicfan12p the timer cannot count down, but its really easy to do it yourself.
Firstly, choose how long you want the session to last, so if you want the game to count down a minute then you'd choose 60 seconds.
Now create a new variable, call it countdown.
Then at the start of the game session, set countdown to 60 (or however long you want it to last)
Set timer to 0
Then, repeat until countdown = 0,
Set [countdown] to ( 60 - round (timer) )The round part can be found in the math functions, it just removes all of the decimals from the timer but you don't have to do this.
Last edited by Prestige (2012-05-20 16:05:09)
Offline
If you're using the equality operator ( = ) try using the less than/greater than operators ( < and >) since those are looking for a less specific condition. Often, the timer can go past the exact 0 second mark before the boolean can catch it.
Offline
You can also do this:
set [StartingTime v] to [10] set [CountingTime v] to [0] reset timer repeat until <(CountingTime) < (0)> set [CountingTime v] to (round((StartingTime) - (timer))) end
Last edited by amcerbu (2012-05-20 18:18:37)
Offline
I can get my backgrounds to switch, but when i get ___ points i need it to switch to a background called congrats, and i can't figure it out! can you help?
thank so very much ,
Al33th3a
Offline
forever <if points > whatever>
broadcast switch backround
Offline
Count Down Timer
Script:
when flag clicked//This can be changed. reset timer set [clock v] to [] set [time v] to [0] ask [Days] and wait change [time v] by ((answer) * (86400)) ask [Hours] and wait change [time v] by ((answer) * (3600)) ask [Minutes] and wait change [time v] by ((answer) * (60)) ask [Seconds] and wait change [time v] by (answer) ask [Milliseconds (If full seconds then put 000)] and wait change [time v] by ((answer) / (1000)) reset timer set [clock v] to (time) repeat until <<(timer) = (time)> or <(timer) > (time)>> set [clock v] to ((time) - (timer)) end forever set [clock v] to [] set [time v] to [] reset timer play sound [BellToll v] until done(Display in seconds.milliseconds)
Last edited by krzysiogawl01 (2012-08-15 08:07:42)
Offline