Overview

This project in C++ using the S2D libraries was my first experience creating a game in C++ in a unique and custom engine, creating whatever idea I could think of. This project allowed me to learn the fundamentals of C++, OOP, good coding standards, and problem-solving to create a working game from a very barebones framework.

The video shows my final product, dubbed, Cold Circle London, which is a 2D top-down horde shooter, incorporating a similar movement style to the Binding of Issac. This game includes custom animated sprites, object pooling to easily add enemies and bullets to the screen, a score and health system, audio to give the user a secondary output when damage is taken or an enemy is spawned, creating different states to allow the program to have a main menu, pause screen and end screen.

Custom Character Spritesheet

Getting Started

After Receiving the framework I began to add movement and create my sprites. This was my first time creating a custom sprite sheet, planning out all the animations that I wanted to have and how those animations would play out, this includes how to make the player look like they are walking, injured, firing, or dead. the image shows my Spritesheet created in Piskel.

Sprite added to game screen

Cherry Picking

When adding my first collectable to my game I ended up with a situation where rather than just flicking the cherries between red and blue, they would also bounce across the screen. To fix this I consulted my previous code for the player object and noticed that the player had an additional variable of position. adding this to the collectable and changing the locational data in the collectable rect the animation started to function as expected.

Game Screenshot

Hunting the PLayer

After getting the player animated and some collectables for the player to chase I wanted to add enemies with some basic AI functionality. To create the enemies I found some sprites and decided I wanted them to follow the player around the screen, to achieve this I incorporated the Dot product to get the angle between the player and the enemy and make them walk in that direction, and turn the sprite to match the direction of travel rather than create a sprite for every direction they could face.

Sprite added to game screen

Looking Good

Finally, to round off my project I wanted to make it look nicer than a character running around a black screen, this involved getting a background image that suited the vibe of the game I was creating, which was added before the drawing of the rest of the sprites, using the painter's algorithm to ensure nothing was hidden from the player. However, I didn't want to stop there as the player jumped straight into the game without warning to prevent this I added a main menu screen and an end screen to allow the player to get ready before being jumped into it. The next logical step from a main menu was a pause screen this was added to give the player a break and also a list of controls.