Spaceship game (asteroids)




Short description:

The game is done in C++ using OpenGL. It was done as part of the coursework where I had to create an asteroids game from a very simple 2d engine. I took inspiration from Star Wars for this game.

Gameplay includes a simple and easy to use controls for the spaceship (WASD buttons). The aim is to earn points by destroying the asteroids. Procedurally generated levels with an increasing number of asteroids. The difficulty doesn't end there, because the more asteroids the player destroys the more enemies spawn (you can see at the end of the video it shows more than 1 enemy spawning for each asteroid destroyed!). To help the player get through the game there are power ups.

Features implemented:

  • GUI
Quite simple but informative GUI. It includes the amount of lives the player has left, the amount of points earned and the current velocity.
  • Controls
WASD and SPACE buttons. W - increases speed, S - decreases speed, A - turns left, D - turns right and SPACE starts a level and is also used to fire lasers
  • Power-ups 
Speed power up - increases the maximum speed of the spaceship
Attack power up - increases the amount of lasers the player shoots
Points power up - increases the amount of points scored per asteroid destroyed
Defense power up - each instance of this power up that is picked up, protects the player from 1 collision.
  • Collision detection
Bounding circle based collision detection between the player and all other objects (except his own lasers) and players lasers with asteroids and enemy ships.
  • AI
Simple AI that is tracking the player's position and shoots when in range. Whenever close to an asteroid or a player tries to evade in a random direction, while evading doesn't fire lasers.

A full documentation is located here:
documentation