Timer Countdown question
allc1865
Member, PRO Posts: 777
Hello everyone
I've created a timer that counts down, but I wanted to know how to make it count down from minutes. For example, 1:40, or 5:00 minutes. So far I only have it so it counts down from 10 seconds or so.
Thanks for any help
I've created a timer that counts down, but I wanted to know how to make it count down from minutes. For example, 1:40, or 5:00 minutes. So far I only have it so it counts down from 10 seconds or so.
Thanks for any help
Best Answers
-
Manto Posts: 796Make an attribute and set it to Minutes*60. Say you want to count down from 5 minutes, set it to 5*60=300.
Timer:
Every second
change attribute timer to timer - 1
Display text
floor(timer/60)..":"..timer%60 -
KevinCross London, UKPosts: 1,894I created a chess clock a little while ago for someone here on the forums. Perhaps you could look at that and see how that one works
http://forums.gamesalad.com/discussion/comment/428009/#Comment_428009
Answers
What kind of attribute is it? Real? Boolean?
Thanks!
I would create a Real attribute and call it Minutes*60?
I'm just trying to understand.
Thanks
Change Attribute: game.gameTimer = 5 * 60
If you want 3 minutes you'd say
Change Attribute: game.gameTimer = 3 * 60
And yes leave it as 0, you set it with a Change Attribute before running the Timer loop example Manto1 provided.