countdown timer help please
![superted](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
hi all , im trying to add a countdown timer to a scrolling level so that you run out of fuel before the level stops scrolling and a life is lost , does anyone have any idea how this would work ? . any help would be gratefully recived
S
S
Comments
:]
Make an attribute called timer and make it an integer with the value you want as your max seconds (we'll be counting down).
Make an attribute called lives and make it an integer and give it the max number of lives you want.
For this example i'll use 10 seconds and 3 lives.
Then in an actor of your choice (I like using a single actor as a controller for attributes) make your timer:
We'll assume you want the timer to stop when all lives are lost.
Make a Rule that says if attribute (lives) > 0
Timer
every 1 second
Change attribute (timer) to (timer)-1
Then another rule that says if attribute (timer) < 0
change attribute (timer) to 10
Then make another rule that says if attribute (timer) = 0
change attribute (lives) to (lives)-1
Now you have your timer and your lives counting down appropriately and stopping when you're out of lives.
S