Hi, I want to make a countdown timer that goes in seconds. I want it to be like countdown in 3 seconds and if it hits zero, an action will happen. It should just always repeat. I also want it to reduce the green bars to make it look like the countdown. (see the screenshot). I wish someone could help me. I would really appreciate it if it comes with a complete event. Thank you very much.
Timers are like stonks, they only go up.
So you’ll need to adjust your thinking about what a “countdown” timer means.
So just create a scene timer called “Countdown”
For each of your green boxes add logic like this:
CountdownTimer < 1 => Show GreenBox 1, Show GreenBox 2, Show GreenBox 3, Show GreenBox 4
CountdownTimer < 2 => Show GreenBox 1, Show GreenBox 2, Show GreenBox 3, Hide GreenBox 4
CountdownTimer < 3 => Show GreenBox 1, Show GreenBox 2, Hide GreenBox 3, Hide GreenBox 4
CountdownTimer < 4 => Show GreenBox 1, Hide GreenBox 2, Hide GreenBox 3, Hide GreenBox 4
CountdownTimer >= 4 => Do whatever action you want to do; Reset timer “Countdown”
That’s the basic approach I would say… very unoptimized… I think you could come up with much smarter logic, but I hope that paints a picture for you.
Another way you could possibly do it:
You could have a sprite for the green time bar, with a different animation for each of the green boxes being filled/empty. Then show that animation based on the value of the Time variable:
Condition: The scene variable “Time” = 3
Action: Set animation of TimeBar to “3”
Thank you guys, it helped me a lot. I’m gonna put a lot of effort for this game. Thank you again.