Final Defense : All Out Enemy Attack

A wave-based top-down shooter where eventual doom is certain. Wave 20 is as far as anyone has reached to my knowledge (leave us a comment with a screenshot if you have managed to get further).

This project was my first complete game for PC using C++ and an OpenGL framework, it was completed Q1 2014.

Being new to vector maths and enemy AI algorithms, I had to think outside of the box for making threatening (but not impossible) enemies. Inspired with knowledge from watching Keith Peters’ series Coding Math I decided to experiment with gravitational forces to dictate the enemy movement. The player would be the centre of the world that the enemies were pulled towards. The hope was that this could create some asteroids style physics for the enemy characters following the player.

There was an issue with this approach. Gravity’s force is applied in relation to the distance of the object it is being pulled towards. i.e. The closer to the player, the more acceleration the enemy would push towards the player resulting in a “stick-to-you-like-glue” style enemy. Experimenting with these forces, I found a balance by inverting the distance part of the gravity equation. So the further the enemy was from the player, the harder they would accelerate then they would slip passed as the player maneuvered out of their way.

The overall goal with this game was to make something simple to pick up and play with a steep difficulty curve as the waves go on. Watching others play the game, it is clear that there is a tight balance between panic, relief and frustration as the player tries to survive each wave and better their high score.

Sound Credit
Gerant Kenneth is responsible for the soundtrack and game effects. The guideline I passed on to Gerant for the soundtrack:

10 looping waves, impending doom, certain failure

Sprite Credits
A free sprite pack from Kenney was used for the player and enemy ships.

You can download Final Defense : All Out Enemy Attack from here
This will only work in a Windows environment with a graphics card that supports OpenGL 4.0 or higher