Walk around a 3D world rendered with raycasting
Features:
- Arbitrary wall geometry; not restricted to boxes
- Sector and portal-based rendering with arbitrary floor and ceiling heights
- Simple wall collision detection
- Level files specified in JSON
- Immediate mode GUI overlay (using Nuklear)
- Level/map editor; modify map geometry while the game is running
- Visual effects with color and gradients
- Runs at 60 frames per second using software rendering (even on a 12-year-old ThinkPad X220)
Inspired by https://www.youtube.com/watch?v=fSjc8vLMg8c and https://www.youtube.com/watch?v=HQYsFshbkYw. Some renderer code and general structure modified from/insipired by this demo.
Install SDL2 by copying the most recent DMG from here to /Library/Frameworks.
$ make
$ ./raycast
You may be able to use the Xcode build system if you'd prefer.
Install SDL2 with your distribution's package manager (or from source) and run make
. You may need to modify the include or link flags in the Makefile.
The Makefile might work with MinGW similarly to how it does on Linux. You could also use the Visual Studio build system instead.
I chose to include Nuklear and cJSON alongside my source code in this repository, so you won't need to download those in order to build this project. SDL is an external dependency.