I am using this as an example for my game. However, in addition I want to add a 3, 2, 1 Go kind of countdown. So basically, right now we are setting the flag to wave if there is an overlap for 3 seconds. So as soon as the overlap starts, I want to subtract 1 from timer every one second till it is zero and display it in the gameplay (basically indicating the seconds one need to keep it overlapped for the flag to be set to waving). Timer behaviour hits just once. Any idea on how to go about it?
Develop games in your browser. Powerful, performant & highly capable.
Create a static variable. Set it to 3
Set a recurring timer for 1 second
Every time the timers goes off, subtract from static variable, then check if the variable is <= 0
Create a static variable. Set it to 3 Set a recurring timer for 1 second Every time the timers goes off, subtract from static variable, then check if the variable is <= 0
Used is Timer running action and every second set the subtracted countdown value. That pretty achieved all that I wanted! Thank you!