how to add a timer in gameplay
Bilzo12
Member Posts: 70
hey everyone my problem is i have a game based on how long the hero is alive for now in the top right hand corner i want the time to go up every second by 1 then when the hero dies and the screen comes down it says the time the hero lived for and the high score
if anyone can help me with this problem ill be very happy.
thanks for reading
bilal
if anyone can help me with this problem ill be very happy.
thanks for reading
bilal
Answers
Contrain the self.Time to a global real attribute (HeroTimer).
To have it look like: 00:00
Make an actor do display the time, use the Display Text Beh. and use this expression:
floor(floor(( game.HeroTimer %3600)/60)/10)..floor((floor( game.HeroTimer %3600)/60)%10)..":"..floor(( game.HeroTimer %60)/10)..floor( game.HeroTimer %10)
Tested and it works.
HC
But the attribute is global which means that you can change scene and display the Hero Active Time on a GAME OVER scene.
Hope this answered your question.
HC