C++ Game Engine

I spent two years working on developing a custom game engine from scratch using C++. It was based off of the SFML library for things like drawing to the screen, but the rest is all original. The specific use case for the engine was to create a 2D tiled game where the level could be parsed and loaded from an XML file, and every object could be created with attached components from a text file. I ended up going a bit overboard with optimization, adding Quadtree collision detection, and using a bitmask to attach components. Unfortunately, I ran out of time so the project is not completed, but you can still view all the code on Github. You will need vcpkg installed to view it as a developer, and CMake should build it properly on your computer. It was also made before generative AI was useful, so you can rest assured I am not just a “vibe” coder.

The Object Class

Objects are the core of most (all?) modern game engines, and anything that uses Object Oriented Programming. For this game engine, all objects have the ability to attach many different types of components, which are derived from a base component class.

The AddComponent function is used to add any component that does not already exist to any object. It also considers if the type of component is Drawable or a Collider, and handles them differently for rendering and physics calculations.

If you are a coder and enjoy looking at other people’s code, follow the GitHub link and explore the depths that this engine goes to!

So much more!

Previous
Previous

Dictator Simulator

Next
Next

Ricochet Noir