20 seconds Countdown with custom fonts
Hi guys,
I need a 20 sec countdown in my game, I know how to work with timer (thanks tshirtbooth) but I need my numbers with my custom font, I´ve made 20 pngs and named them 1.png, 2.png etc, what’s the best way to display my custom numbers making them change to the following number as the countdown runs? Thanks for your help!
I need a 20 sec countdown in my game, I know how to work with timer (thanks tshirtbooth) but I need my numbers with my custom font, I´ve made 20 pngs and named them 1.png, 2.png etc, what’s the best way to display my custom numbers making them change to the following number as the countdown runs? Thanks for your help!
Comments
I have done that in my recent game as well.
Let me search for the thread
http://forums.gamesalad.com/discussion/38935/custom-font-timer-problem#Item_16
floor(( game.Timer %100)/10)..".png" (1st digit Sec)
floor( game.Timer %10)..".png" (2nd digit Sec)
And game.timer is just every 1 sec -1 to itself.
each rule will tied to a individual 0 image for the counter
. . . .as simple as this . . .
Here's my demo
https://www.amazon.com/clouddrive?downloadById=be7b9c4e-4f9b-4102-9dc5-fe67a12ae235&attachment=0
"lolz that might work"
It works just fine.
Itll work if your not dynamically changing the amount of time in the timer, the duration of the countdown, and the direction of the countdown.
What glgames has is spot on, and its not as difficult as it seems. You just make sure your number images are 1.png,2.png and ect.
Then you just have separate actors for each digit and constrain its image to the corresponding expression.
"Itll work if your not dynamically changing the amount of time in the timer, the duration of the countdown, and the direction of the countdown"
As franken2778 says in the OP, he needs a 20 second countdown, he makes no mention of this countdown dynamically changing, changing 'direction', changing duration (or any of a thousand other possibilities) ?
He has 20 PNGs that he needs to step through, 1 second each, the animate behaviour seems the most straightforward way as far as I can see, no attributes, no constraints, no rules as such, no separate actors (etc).
cheers
"I know, i was pointing that out in case others read this and are wondering what the point is off doing it the other way, and if he needs that down the road."
Yes, of course, GLGames method is vastly more flexible / applicable. I was responding to this:
". . . I need more experience with gamesalad; do you know a simpler way to do this . . . "
, my way works with any amount of integer count up or down the custom fonts will work.
http://www.4shared.com/zip/ITShV-yB/Countdown_Demo.html?
Worked now, thank you very much!
1- create a interger called time
2- create 2 actors and use constrain attribute. Constrain SELF.IMAGE TO
actor 1: floor(( game.Timer %100)/10)..".png" (1st digit Sec)
actor2: floor( game.Timer %10)..".png" (2nd digit Sec)
3- make another actor called "time controller"
4- create a rule with timer and change attribute:
while time > 0
every 1 second
change attribute game.time to game.time-1
5- Put your actor on a scene.