November 16, 2018

Cave Crashers

Ever since my last post, I’ve been hard at work on my engine, coded in C++. Today, I felt I had reached a point where I could feasibly create a project, and that I did. I decided to create a simple game, where you click to shoot, and the character moves in the opposite direction. Furthermore, the game consists of only 2 colors, black and white. The player and his bullets are black, whilst the enemy is white. The background starts as white, but flashes black when firing.

Oh no, there’s nothing here!

I’m not alone!?!?

Utilizing vector math, movement turned out to be fairly simple as all I had to do for propulsion was add a force towards the mouse for bullets, and an inverse force of a similar magnitude to the player. Furthermore, I utilized vector math to move the spiders towards the player, rotating to face the player. Lastly, waves were added to spawn enemies incrementally, and a timer was built to indicate your survival.


The engine itself was based to an extent off of most contemporary engines, such as Unity, Unreal, or GameMaker. The actual objects in the game have sub scripts for each different component they may have. Everything, from the object’s translation, to its velocity vectors, is a separate script that must be attached to the object.


Through this project, I learned much about C++, and about lower level languages. I was forced to manually do pretty much everything, from mouse input, to loading sprites, to allocating and freeing memory. I’d say this project was a success, I learned much about the language, and more about the inner workings of video game engines, and of higher level languages as a whole.


Click here to download a current version of this project.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.