Link timers with a specific object

I wanna make this : when my player hit a enemy snake , the snake jump a little bit WAIT 2 SECONDS a then change color to red and destroy The Wait action its really important here because i can use timers but dont work properly THX :smiley:

screenshot from your events please, and explain what isn’t work.

Screenshots of events will definitely help troubleshoot your existing code, but without seeing them, you might find it easiest to use the timers with variables. For example: create a scene variable named “wait” - leave the value blank.

Condition: Variable wait is = 0
Action: Pause timer of snake

Condition: player is in collision with snake
Do = 1 to scene variable wait
Unpause timer of snake

Condition: the timer “wait” of snake is greater than 2 seconds
Do = 0 to scene variable wait
Change snake animation to red (I’m assuming you’ll be using a sprite to change the color)
delete object snake
reset timer

All of the timer events will ask for a name, I’d probably keep it simple and use “wait”

Timers always have to be reset. The pause/unpause is handy because it will help you control when it starts and stops, otherwise it will start at the beginning of the scene and you want it to start with player collision.

Hope that helps!


thx i will test this and let you know if it works!