Arena Survivor: Part 3: Survive the Swarm
Spawn enemy waves with timers, detect collisions between enemies and the player, use groups for entity filtering, and create escalating difficulty.
No login required.
Wave Setup
Your shooter works, but enemies just trickle in forever. Let's add a wave system with a counter, a timer, and a spawn loop that drops groups of enemies at once.
Constant spawning gets stale fast. Waves give fights a shape: a rush of enemies, then a quiet moment to breathe before the next group hits harder.
Loading game...
Click the game window to interact with it
What You'll Build
You will create an enemy spawning system that sends waves of enemies at the player. Enemies chase the player using direction vectors, die when hit by bullets, and damage the player on contact. A Timer node controls spawn rate, and groups let you filter enemies from other nodes. The difficulty escalates as waves progress.
Learning Goals
- ✓Timer nodes and the timeout signal for recurring events
- ✓Connecting signals in code with connect() and in the editor
- ✓Node groups for filtering (add_to_group, is_in_group, get_tree().get_nodes_in_group)
- ✓randf_range() and randi_range() for random spawn positions
- ✓Tracking game state with variables (wave count, enemies alive)
GDScript Concepts in This Part
Tips
- ✨Spawn enemies at random positions along the screen edges using randf_range() — this prevents them from appearing on top of the player.
- ✨Use groups to tag enemies so bullets can check is_in_group("enemies") before dealing damage.