Trouble resetting my scene
Hey guys having a bit of trouble resetting a scene I have for a "time attack" mode....
To display the game clock, I set up a game "start time" real attribute. To display the time in the actual time attack mode I have an actor displaying game.time-game.start time. So the whole mode ending is dependent on when game.time=60 it spawns an actor showing your score and then I have a retry button. However, I cant seem to get it to reset correctly. A few things I have tried....when "retry" actor is touched:
change att. game.time=0
No dice there.
Then I tried a simple reset scene, but that didnt work either.
It seems I cant get my game time within time attack to reset again back to 0 for another round.
Any input is appreciated as always.
To display the game clock, I set up a game "start time" real attribute. To display the time in the actual time attack mode I have an actor displaying game.time-game.start time. So the whole mode ending is dependent on when game.time=60 it spawns an actor showing your score and then I have a retry button. However, I cant seem to get it to reset correctly. A few things I have tried....when "retry" actor is touched:
change att. game.time=0
No dice there.
Then I tried a simple reset scene, but that didnt work either.
It seems I cant get my game time within time attack to reset again back to 0 for another round.
Any input is appreciated as always.
Comments
game.leveltimer
And then when you want the timer to start set a timer behavior for
Every 1 second
Change attribute game.leveltimer to game.leveltimer+1
if you want tenths of a second also you would use
Every 0.1 seconds
Change Attribute game.leveltimer to game.leveltimer+0.1
Then use you display text or custom fonts exactly like you would any other timer.
When the scene starts (or when you want the timer to start) you can do a change attribute game.StartTime to game.time. Then when the scene is over or the level is over or whatever, do a change attribute game.EndTime to game.time.
Then a simple game.EndTime - game.StartTime will give you the time the level took the player.
Does this help you?