How to make a wave system

I want to make a wave system that during every wave a new set of zombies spawn but evreytime its the same set OR it is a specific ammount of zombies or the zombie types like:
Wave1: 2 basic zombies
Wave2: 2 basic zombies, 1 fast zombie
ETC
Could someone help me?

Hello!

So, a while back, I made a game (you can play it here if you want - it’s not great, but I’m proud of it) that had enemy waves. Thanks to some help, these are the events that I got:

Basically…

  1. You need a scene or global variable to keep track of which wave you’re on. Pick whichever way you want to signal that a wave is over, then +1 to your variable. In my case, in Wave #1, the player had to kill 6 or more enemies to advance to Wave #2.
    1a) I also added a timer to delay the start of each wave.

  2. You’ll need a timer. This will tell your game how long it should wait before spawning the next enemy in the wave. For me, each enemy spawned at a rate of 0.75 seconds (be sure to add the action “Start (or reset) the timer” so that it refreshes the timer every 0.75 seconds. Otherwise the timer will keep going and no other enemies will spawn.

  3. At the top of the image are events to get the enemies to move toward (follow) the player as long as they’re within a certain distance of each other.

In your case, I would hazard a guess that you would need to set maybe an object variable and count the number of times an enemy instance spawns. So, once it’s reached a certain amount, you stop the timer so that they stop spawning. So, I’m thinking maybe something like this?

Conditions:
The timer “SpawnRate” is greater than 0.5 seconds.
Trigger Once

Actions:
Create object Zombie at X() and Y()
Object variable EnemyQuantity of Zombie +1
Start (or reset) the timer “SpawnRate”

Then

Condition:
Object variable EnemyQuantity of Zombie ≥ 10

Action:
Stop timer “SpawnRate”

Try that out and see if it works. I’ll admit that I’m not sure if the second part should be a sub-event or not, so please feel free to get a second opinion :sweat_smile:

1 Like

This is good I’ll try it out I had the same idea but I’m basically remaking a game I made on scratch and the wave system on there was all over the place and was a mess I wanted something organized because I’m thinking about putting my game on steam but I’ll try this out! Theres gonna be a lot of waves and types of zombies lol

1 Like