Progress Update: Boss AI and Wave Spawner

Boss AI

I have created an enemy boss that will target the player and move left and right.

I use this to get the front of the boss to target the player by finding the distance and rotating the boss to point at the direction it would go to close the distance. Slerp is used to get the smooth turning the boss uses instead of the boss snapping to the player.

I use this coroutine to get the boss moving left and right. every 3 seconds the boss will change direction.

Wave Spawner

I have also created a wave spawner using class inheritance and an enum to hold the current state the wave spawner is in.

This is the class that the waves inherit their attributes from.

This is the enum that defines the 3 states the wave spawner will be in. By default it is set to counting.

These variables hold the values for the time the spawner will wait to start spawning. Each new wave spawns five seconds after the wave starts giving the player time to rest.

To start the spawning I check to see if the wave has waited five seconds and make sure the state is not already set to spawning.

When the spawning starts I set the state to spawning. iterate through number of enemies that are suppose to spawn that round and wait a set amount of time between enemy spawns. Once the enemies are all spawned the state is set to waiting.

To spawn the next wave I am checking to see if any enemies are still alive

If no enemies are alive I begin spawing

Unity Game Developer and C# Programmer