Hmm…Wave sequencing, why don’t we try and start with something that should be fairly simple? Let’s make it so that the first wave spawns only 5 enemies, second 10 enemies and the third unlimited.

In order to accomplish this we should probably create a new script and call it; let’s…

Before we can have the player fire a missile, we need a way to set our _closestEnemy variable to the closest enemy. Googling ‘nearest target unity’ and searching through gives us the following code to pilfer:

We can add this method to the MissileBehaviour script as well as adding the…

Since we have allowed the enemy to shoot and damage the player, maybe we should add a collectable that can heal. In order to accomplish this, we will need to add another case to our powerup script, such as:

Then we need to add this new method to our player…

I guess since we limited the number of times our player can fire, we should add a collectable that will refill the ammo. In order to accomplish this, we will need to add another case to our powerup script, such as:

Then we need to add this new method to our player script.

Jason Schneider

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store