This was one my favorite school project, so I decided to rebuild it, using C++ and SDL, and add more features such as wall textures and a map editor.
What is a RayCaster?
Raycasting is a technique used in computer graphics and game development to simulate a 3D perspective by projecting rays from the viewer's point of view into a 2D map. It determines what the viewer sees by detecting the first object each ray hits, allowing for efficient rendering of scenes.
On Linux, you can simply download the dependencies from your favorite package manager:
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-devOn Mac, use brew to set up the required dependencies:
brew install sdl2 sdl2_image sdl2_ttf sdl2_mixerOn Windows, run the provided batch script setup-windows.bat to download and install the dependencies.
cmake . -B cmake-build-debug
cd cmake-build-debug
make./RayCaster-w 800Set window width to 800px-h 600Set window height to 600px-fEnable fullscreen modem myworld.wldTo use world stored in filemyworld.wld
| Key | Action |
|---|---|
| ESC | Exit |
| Z | Move forward |
| Q | Strafe left |
| S | Move backward |
| D | Strafe right |
| + | Zoom in |
| - | Zoom out |
| ² | Show/Hide fps counter |
| Key | Action |
|---|---|
| ESCAPE | Exit |
| 0 - 9 | Select texture |
| + | Next texture page |
| - | Previous texture page |
| Left click | Set tile |
| Right click | Remove tile |
| Shift (hold) | Move the map |
| S | Save world |



