Skip to content

reznakt/ray-casting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Ray Casting

License GitHub Workflow Status GitHub repo size GitHub repo file count GitHub repo LOC

A simple experiment with ray casting and C.

Play online: https://reznakt.github.io/ray-casting/

🤔 About the project

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.

💻 Built with

  • 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

🚀 Getting Started

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)

🎮 How to Play

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

📷 Screenshots

image
Normal mode
image
Flat mode

📝 License

This project is licensed under the MIT license - see the LICENSE file for details.

❤️ Acknowledgements