Challenge: Create a new enemy for our wave system
Now that we have a rudimentary wave system in our game, we want to create an elite enemy for our later waves. First, we copy our enemy prefab, remove the script, rename the object, and recolor it:
Then we attach a new script to the elite enemy; we will copy the enemy script to this one, attach the relevant GameObjects (the laser prefab, in particular), and then modify the script in the following ways:
in void start:
startFiring is modified:
and CalculateMovement is modified:
Then, we will modify our SpawnManager script to include our new elite enemy:
and our spawn routine:
now, we have an elite enemy with a different movement type, as well as burst fire, that will spawn in later waves of our game.