Saving Time Score
allc1865
Member, PRO Posts: 777
Hi everyone, I needed help with showing your best time at the end of your game. Say, your in a race and being timed, when your done with the race, have it show your best time.
Can anyone help me with how to do this?
Thanks!
Can anyone help me with how to do this?
Thanks!
Best Answer
-
tatiang Posts: 11,949Create a real attribute called game.raceTime and another one called game.bestTime. Set game.bestTime to a large number (e.g. 9999).
When [race start condition]
.....Change attribute game.raceTime to 0.
When [race is over condition]
.....When game.raceTime < game.bestTime
..........change attribute game.bestTime to game.raceTime
.....DisplayText [game.bestTime]
Otherwise
.....Timer: Every .1 seconds
..........change attribute game.raceTime to game.raceTime + 0.1
.....DisplayText [game.raceTime]New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers