CSC 461: Computer Graphics tasked me with creating the classic game Asteroids using OpenGL and C++. Everything was created with basic polygon drawing and shading. The asteroids were made with around 50 triangles with a few randomized sizes to give diversity.
The player’s ship is controlled with the Arrow Keys and accelerates with the X button. When the Z button is pressed, the ship fires a bullet in the direction it is facing. The asteroids come in 3 sizes: Large, Medium, and Small. When shot, the asteroid breaks into two smaller asteroids (the smallest size is destroyed). When only one asteroid remains, a UFO enters and progresses across the screen. It fires in random directions, but occasionally aims at the player’s ship.
The first level is contains only one Large asteroid, and each subsequent level contains an additional asteroid. After the third, it returns to a single asteroid. This allows alternating difficulty without asteroid clutter.
The game keeps track of the score and saves the highest score achieved during the play session.
Download: Asteroids (299 KB)