How to create waves of enemies

Hello! I want to have enemies spawn in waves, with variables like 1) Number of enemies 2) Type of Enemy 3) Time gap between each wave.
Could someone explain how to do it?
I’ve found this topic How to manage waves of enemies, but didn’t understand it at all :frowning:

Hi, could you explain which part is problematic for you?

Do you know how to

  1. spawn enemies
  2. choose different types of enemies
  3. set a timer?

I can’t figure out how to make an array to input the specific enemies with different properties. For example,


here’s my code for 1 type of enemy, how do put all this code into one variable, which I could use in array?

Also, I struggle with choosing different types of enemies. In my game I want to have game flow as following:
Game starts…time gap to prepare to fight enemies (10 seconds)…wave 1 comes(player kills 5 enemies)…time gap to prepare to fight wave 2 (15 seconds)…wave 2 comes(player kills 10 enemies)… time gap to prepare to fight wave N (N seconds) … wave N comes.
In each wave there should be different type of enemies.

I figured out only the way to manually set up those waves, BUT it will take centuries to make it by hand.

You could set all the variables and values for each enemy as a struct (list) within an array called enemies.
If you check these two posts there are good explanations how to do that:

Okay, what do you mean? At the moment it reads like a game design question (which enemy and how many should spawn in each wave), which would be difficult to answer as it really depends on your idea for the game.

The alternative would be to randomize the selection. Did you try to do that?