Event with the end of countdown timer

Hello
Now i finished the event ( count down timer with an condition )
I want an action when the countdown set to “0”
but I tried a lot with no useful solve
here is a pic


the last sub event doesn’t work
who can help with a right way??
thank you

why are you even using timer?

I want an action when the countdown set to “0”

If you want this, you can do if timer is greater than -1

A timer is set to 0 when it is first started or reset. So you’re best to perform the action when you reset the countdown timer.

Your last event will only be checked if the cursor is on the ten object. Is this what you want? Or do you want it checked all the time? If all the time, move/drag the subevent to the left.

Also, if you really must check a timer is 0, try changing the 1 seconds in your last event to 0 seconds. That may work.

thank you for reply
look, i want ( game over when countdown is zero ) but when i touch or press ( ten ) game over appeared.
okay, i want to end the game if the countdown finished the ( 10 ) seconds

So it sounds like you want the last subevent (from your earlier screen shot) to check that the countdown timer > 10 seconds. Don’t have it inverted, just have it so it reads The timer "countdown" is greater than 10 seconds

You also will need to move the subevent to the left, so it’s at the same level as the “cursor/touch is on ten” event.

no i want it less than zero

You’re not showing enough of your events for folks to help.

If I remember correctly, you are using a timer named “Countdown” to subtract from a variable to display as a countdown timer. You’ll need to show the whole event sheet that includes that.

Right now, your events will not work because you’re saying “Every frame that the mouse cursor is over 10, so long as the countdown timer is NOT greater than 1, do this thing” (So roughly 60 times, if your game is running at 60 frames per second, as it’ll be not greater than one every frame from 0 to 1)

It is highly unlikely this is what you want to happen, so you’ll need to show the rest of your events that involve the timer for people to help.

Hi sir
that is all events in my scene

I just want to put a condition says ( if countdown is less than zero)
the action ( game over and restart that level )

im new but i think you timer not work or wrong.I remember this style gdevelop examples countdown timer there time 0 then game over maybe help you.

So, you are not making 0, 1, 2, 3, 4,… but instead 5, 4, 3, 2, 1, 0,…
I think you can do, if countdown timer is greater than 1 sec, change the value of variable “countdown” - 1, reset timer countdown
if variable countdown = -1, stop timer countdown, change the text to gameover, change the value of variable to 0

finally i did it with this conditin
if the variable of timer_number = 0
then gameover and restart

thank you again all of you

1 Like