MicrolearnENPTES

Timers and spawning

Lesson 7 of 16 · GDev.Micro

A level with nothing left to do is finished. To keep the player busy, new coins should keep spawning.

A scene timer counts seconds. The condition timer “spawn” > 2 seconds becomes true two seconds after the timer starts. Create a coin, then reset the timer so the count starts again.

Forgetting the reset is a classic bug: the condition stays true and a coin appears on every frame.

In GDevelop, the action Start (or reset) a scene timer starts the count. Objects can also have their own timers.

Every 2 seconds, create a new Coin at a random position.

Do it in the browser: a real game design tool, a short mission and instant feedback. No install.

Start this lesson — free
← Trigger onceEnemies and lives →

All lessons · GDev.Micro