Dodge Danger

Feb 10, 2024

I created a small cross-platform 3D obstacle dodging game under 500 KB.

A small new game

I spent around a week creating a small game called Dodge Danger. I also open sourced the game. Check it out on GitHub.

In this game the player must dodge the obstacles which are 3D rendered cubes.

Gameplay for Dodge Danger

Dodge Danger is under 500 KB both on macOS and Windows. On Windows the game is a standalone executable. I even built an arm64 version for Windows but I have not tested it yet. No audio is used in this game, but the game does support using game controllers.

The game has minimal dependencies and mostly uses system libraries. The texture loading, font loading, window handling, and game controller support use the system libraries and the rendering uses Metal and Direct3D 11. I copied and pasted a large amount of the engine code from Sky Checkers so the game-specific code is just around 1,000 lines of code.

My goal was not to make a “game engine.” My goal was to create another game, but I achieved this by re-using a lot of the code from my previous game. I believe this is the right way to go about creating a “game engine.”

I also made some improvements when making the second game. For example, I found out I can embed the HLSL shaders as header files at compile time instead of manually loading their byte contents from a file at runtime. I also fixed assumptions about HiDPI my previous game didn’t handle. Still, Dodge Danger has some future improvements I could make. For one, the font rendering is very inefficient and uses more memory than necessary. This was not a big issue in Sky Checkers.

I am also going to use this game as a tutorial for searching for pointers using Bit Slicer.

If you have a chance of trying out Dodge Danger, let me know what you think!