Lunar Lander



Other Projects

About Me

Contact Me

Back to games

Lunar Lander

This is a 2D Lunar Lander clone with some extra features. The player must land their lander on landing pads of varying sizes on the lunar surface. The player must avoid enemy spacecraft and bullets while trying to land. The player can also attack enemies as the lander can fire bullets also. There are three difficulty modes which affect fuel supply, weapon ammunition, enemy abilities and the strength of the lander.

This was a second year Graphics project. It is coded in C++ using OpenGL. The objective of the project was to create a game which incorporated; 2D translations and rotations, 2D object rendering, explosion effects, some form of autonomous enemy, a HUD, multiple difficulties and 2D collision detection using vectors.

For collision detection; I used a "dot product" based algorithm to check between objects and the terrain, vector distance calculations between bullets and the lander and circle to rectangle intersection between the lander/bullets and the enemy. I also wrote algorithms to create explosion effects when the lander or an enemy is destroyed. The map is generated randomly for each game and the camera tracks the lander across it. The map also wraps around upon itself.