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…


Currently, we have an ammo count. How about we add a maximum value to that?

This can be accomplished, first by adding:

to:


Having our enemy only move straight down the screen can be challenging for the player, however, why don’t we step it up a notch. …


Googling “camera shake unity” gives us the following code to pilfer:

Creating a script called CameraBehaviour, and adding it to our Main camera and then adding the above method to this script.

Adding the following variable to our Player script:


A while ago, we added the use of thrusters to our player. Let’s add a visual cue as to the use of it. Since it is; a ‘visual’ cue; we are going to need to add images to our scene. …


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…


First thing we need to do is create a missile object and then create and attach a script to it; let’s say MissileBehaviour. Adding the following method to this script:

We will also need to add a variable _missleSpeed and set it to say 5. …


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.


First we will need to add a variable to our player script as below:

Then we will need to add the below to the playerMovement() method of 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