Creating a boss battle, part 3

All of the functionality for my boss character is done, and now I just need to make the functionality for the boss level to start and the game to end when the boss is destroyed.

I added a check to the spawning routine to see if the current wave is the final one. If it is, the wave timer UI element will tell the player the boss round is starting, then instantiate the boss. The boss will make its dramatic entrance, and the battle is on!


Now when the boss is destroyed, I want it to slowly fade away before disappearing. I copied the same code that I used for the railgun fading and added some logic specifically for the boss. When it’s destroyed, it will show a UI element letting the player know they won the game and will prompt them if they want to restart.