The year is 2525. You're yet another expendable contractor, assigned to one of the deadliest jobs in the galaxy: crystal extraction from unstable asteroid belts deep in space. Armed with only your teleportation blasters, you'll have to harvest as many alien crystals as possible before the asteroids accelerate faster than you can react. One collision, and it's over...
This game was originally my Computer Science 30 final project, and I later submitted it to Summer of Making. The code is made from scratch in C++, including the software rasterizer, the game engine, and the game itself. It runs in the terminal with just about zero extra dependencies on most Linux systems.
- Renders and transforms meshes loaded from OBJ files
- Colors everything based on rules using barycentric weights
- Made surprisingly decent-looking objects
- Camera has basic shading, z-buffering, etc.
- Camera, hitbox, and HUD move around the world from input
- HUD arrow guides you by pointing forwards
- Circle colliders are colliding
- Player-asteroid and bullet-asteroid/crystal collisions
- PPM image rendering capability
- Terrible numeric font rendering
- Learn some basic linear algebra
- Have the engine be reasonably fast and correct
- Understand all of the code that I'm writing
- I now realize that this was quite ambitious
- Avoid requiring non-standard libraries
Heavily consider running a version of the project from GitHub releases if you aren't already. This stops you from having to build the project and download libraries yourself, and also guarantees a stable version of the game.
The following shows how to build the current source code:
- Navigate to the project directory
- Create a directory
liband subdirectoriessrcandincludewithin the project - Download miniaudio here, find
miniaudio.candminiaudio.h, and move them tolib/srcandlib/includerespectively - Run
maketo compile- Requires g++ and Make to be installed
- Modify your keyboard settings: increase repeat rate and decrease repeat delay as much as possible
- You can skip this, but input will be much less responsive
- Decrease your terminal text size (
Ctrl+-) to fit the engine's resolution - Run
./mainto run the project
- Consider using a particularly fast terminal like kitty
- This game is surprisingly computationally expensive to run
- I attribute it to the high number of relatively high-poly asteroids