This project implements a simple raycasting engine in C, inspired by early 3D games like Wolfenstein 3D. Raycasting is a rendering technique used to create a 3D perspective in a 2D map by casting rays from the player's viewpoint and calculating intersections with the environment.
- 2D Map Rendering: Display a simple 2D map grid representing walls and empty spaces.
- Raycasting Alogorithm: Calculate and render 3D walls based on ray intersections with the map
- Player Movements: Navigate through the environment with basic movement controls.
- Wall texturing: Apply textures to walls for a more realistic appearance.
- Simple Ligting: Implement basic lighting effects to enhance visual realism.
- C compiler (GCC, Clang, etc)
- Make (optional, for build automation)
- SDL2 (for window management and rendering)
- Clone the repository:
git clone https://github.com/kinyarasam/Raycasting-C.git
- Install SDL2 (if not installed):
- on Ubuntu:
sudo apt install libsdl2-dev
- on macOS:
brew install sdl2
- on Ubuntu:
- Build the project.
make
After building, you can run the project with:
./raycasting
- Use arrow keys or
W
A
S
D
to move the player. - Press
ESC
to exit/quit the application.
src
: Source Code files.include
: Header files.assets
: Textures and other graphic assets.Makefile
: Build configurations.
Contributions are welcome! please fork the repository and submit a pull request for any enhancements, bug fixes or new features.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes. (
git commit -m 'Add some AmazingFeature'
) - Push to the branch. (
git push origin feature/AmazingFeature
) - Open a pull request.
This project is licensed under the MIT License - see the LICENSE for details
- Lode Vandevenne's Raycasting Tutorial for foundation concepts.
- The SDL2 community for providing and excellent library for multimedia applications.