How to Create a Wave System in Unity (Part 4 — Adding More Enemies each Wave)

Make the game harder throughout the waves

Rusben Guzman
1 min readAug 4, 2021

Objective: Spawn more enemies each 2 waves

This is a simple code added to the start spawning function in the spawn manager script. The thing is check if the wave counter is multiple of 2, it means each 2 waves this code is gonna be executed. Within the if statement we only decrease the _spawnEmenyDelay by 0.2. Each time we decrease the value of this variable the spawn manager is able to spawn more enemies during the 10 seconds. In the if statement we also check if the spawning time is greater than 1, the idea is to have a max difficulty then once the _spawnEnemyDelay is equals to 1 the game keeps the same difficulty.

Good to go!!! We have a completely functional wave system for our game.

--

--

Rusben Guzman
Rusben Guzman

Written by Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

No responses yet