Countdown Timer


#1

Hi i am new to Gdevelop and i am trying to create a countdown that will start when the sprite starts moving and ends when he reaches the last door. also, if he doesnt reach it by the end of the countdown for it to start him over again at the beginning. what is a good code for all of this and also, i have 2 doors. do i need to make 2 separate doors for this to work?

Thank you <3


#2

Hi,
So, the entire level has a timer, the timer only starts when the player starts moving (rather than when the game finishes loading), and they have to go through every door?
Gotta ask, what does a door do exactly?, is it just a collectible or does it teleport the player to a different place? If it teleports the player then you may need serparate door objects.
Otherwise, when a player goes through a door, you can “delete” the object in-game, and use an event to check for “amount of objects in scene” event to stop the timer.

If the timer runs out, the easiest way is to use “Change scene” event, using the same scene name.


#3

Can do variable ID on instances of the same object, then set different actions. :slight_smile: