I'm working on a gamejam entry and have a timer in my game. It counts seconds and milliseconds, timer starts when the layout begins and I want the timer to pause at the end of my level(aka when the player crashes the plane). I want this time to be kept at the end of the level, so the player can clearly see what his time was for the run before starting the next attempt. Can anyone suggest something that would make this happen? I'm having trouble adding this, and I feel its vital to my game. Ultimately I'd want a "high score" feature, but mostly for now, I just want my timer to stop when the player crashes and retain its value until the next restart.
I've attached a screenshot that shows you how my timer works.
Appreciate any help. Thanks.
There are several ways that you could do this , first take the add timer action out of the every tick event . If the player disappears then put the add to timer action under a is visible event or any other event that relates to the player being active , then the timer would not increment when the player is invisible or has crashed .
Develop games in your browser. Powerful, performant & highly capable.
Appreciate the info.
I was able to stop the timer by adding a 'gameOver' variable to the Every Tick event. When I crash, I set the variable to 1. Every Tick no longer applies because it only runs if that variable is set to 0. After much testing, it works the way I hoped it would. I think
For anyone else interested in timers: this post was a HUGE help! Especially the .capx file posted by Ramones. Of course the official document for CS2 timers was also a help. EDIT: my URL was removed due to low rep, just google "construct 2 milliseconds" for a thread called "Convert milliseconds to.."