A simple experiment with ray casting and C.
Play online: https://reznakt.github.io/ray-casting/
This project is a simple experiment with ray casting and C. It's not really a game, but rather a proof of concept. You can walk around and observe the environment, which consists of walls and an open sky.
I previously made something similar in Python, but it was quite slow (~100 fps), so I wanted to see how fast it could be in C (it's ~2000 fps). I also really like C and ray casting, so it's a fun project indeed.
- C99
- CMake
- SDL2
Tip
On Debian-based systems, you can install all necessary dependencies with:
sudo apt-get install -y cmake libsdl2-dev libsdl2-gfx-dev
Tip
You can also download a pre-built binary.
To get a local copy up and running, follow these simple steps:
git clone https://github.com/reznakt/ray-casting.git && cd ray-casting
cmake -B build/
cmake --build build/ -j$(nproc)
Currently, there are no game features per se. You can walk around and observe the environment. However, you can configure various parameters by modifying the header files:
- Screen size
- Field of view
- Number of rays
- Keymappings
Normal mode |
Flat mode |
This project is licensed under the MIT license - see the LICENSE file for details.
- Lode Vandevenne for the legendary ray casting tutorial