This was a project for a module assignment in which we were required to create a 2D sprite-based game that is a homage to a retro arcade game whilst using 2 software patterns that we had been taught during the module.
To decide what game I would like to recreate I started playing through a number of retro games before finally deciding on the classic missile command.
To facilitate the engine I created a variety of systems to assist me in creating the gameplay logic for the game using 3 main software patterns shown below:
The singleton pattern. I used this for the base image handling classes for SDL so that I could ensure I could always access it from anywhere and that only one class was handling the raw image processing.
The command pattern. I used this for my input handling system. Each key in my input class could have a command mapped to it allowing me to easily handle input more. In addition, this allowed for modifying the user interface in a much easier manner without many code changes.
The prototype pattern. This pattern was used any game object that was required to be used or spawned multiple times, such as the multitude of bombs that spawned. An inactive version of the bomb would be stored in a spawner class that whenever I wanted a new bomb I would call a spawn function that would copy all of the bomb variables from the prototype to create a new one.