Project 1: Space Shooter

The Boss part 3

Spawning the boss wave, victory screen and the help menu

Eero Saarinen

--

Staged gameplay showing the transition between the last wave and the boss wave, due to file size constraints the number of waves and enemies had to be manipulated.
The transition between the last wave and the boss wave, due to file size constraints the number of waves and enemies had to be manipulated.

All there is to do for the boss enemy is to make the boss wave. Once this is done the game is ready, although I will be adding a victory screen if the player wins and a help menu to aid the player.

Showing the SpawnWavesRoutine’s alterations after the boss is added.
The SpawnWavesRoutine’s alterations after the boss is added.

The same code that spawns the other waves is used for spawning the enemies in the boss wave, the only difference is that when the enemies are killed then the boss will be spawned. In the code the total number of waves is increased to six from five, which means that the boss wave will have 35 normal enemies in total.

Showing the SpawnBoss method.
The SpawnBoss method.

Once all these enemies have been killed, the wave counter is seven which will end the while loop and enable the boss to be spawned. Before the boss is spawned there is a six second wait. When that is over the SpawnBoss method is called, this will instantiate the boss and start the coroutine for spawning the power ups.

Showing the DeathRoutine coroutine.
The DeathRoutine coroutine.

If the player defeats the boss, the boss’s OnDeath (shown in part 1) starts the coroutine called the DeathRoutine, which instantiates the explosions and calls the UIManager’s method GameOver with the Boolean argument true.

Showing the GameOver method.
The GameOver method.

This method will then call the GameOverSequence method with the same argument to begin the game over scene. As a default the method assumes that the player has lost, but in case of winning the game the victory scene will be shown instead. Both the defeat’s game over scene and the victory scene will have the same flicker action.

Showing the GameOverSequence method.
The GameOverSequence method.

Then the last item is the help menu, this is just a text shown at the lower right side of the screen, this can be easily triggered on or off with pressing the H-key. The UIManager keeps track of this in its Update method when it’s pressed.

Showing the UIManager’s Update method.
The UIManager’s Update method.

--

--