How can Timer run in background?
T0bsom
Member Posts: 9
How can I run a timer so count how much you have played in the game. The timer will only count the game scenes and not pause scene or menu scene, but will only be displayed in the pause scene. The timer will run in background. How can I do that?
Comments
If you just want a timer that runs in-game while the app is active then you need to make your own timer:
When game.paused (boolean) is false
.....Timer every 0.1 seconds
..........Change Attribute game.elapsedTime (real) to game.elapsedTime+0.1
Then, whenever you switch to a pause or menu scene, set game.paused to true and whenever you switch to a game scene, set game.paused to false.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User