The 2D Raycasting Maze Game is a first-person 3D maze game similar to early titles like Wolfenstein 3D. It is developed using the C programming language and the SDL2 library to render a 3D world from a 2D map via raycasting. The player navigates through mazes while avoiding obstacles, with a goal of reaching the maze"s endpoint. The game runs on both macOS and Linux.
Project Landing Page | Preview
LinkedIn | X (Formerly Twitter)
-
Clone the repository:
git clone https://github.com/Peplinn/Maze-Game.git
-
Navigate to the project directory:
cd 2D-Raycasting-Maze-Game
-
Install SDL2 if it"s not already installed:
- On macOS:
brew install sdl2
- On Ubuntu:
sudo apt-get install libsdl2-dev
- On macOS:
-
Compile the code:
gcc src/*.c -Wall -Werror -Wextra -pedantic -o main.exe -lmingw32 -lSDL2main -lSDL2
-
Alternatively, compile the project using
make
:make
-
Run the game with a provided map:
./maze defaultMap
-
Navigate the maze using:
- Arrow keys: Rotate and move forward/backward.
-
Create custom maps to play by following the map file format.
0
: Floor/walkable space1
: Red Wall2
: Green Wall3
: Blue Wall4
: Yellow Wallp
: Player start positionw
: End goal
If you"d like to contribute to this project:
- Fork the repository.
- Create your 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.
- Wolfenstein 3D - Inspiration for this project.
- Lodev"s Raycasting Tutorial - Core algorithms for raycasting.
- Lazy Foo" SDL Tutorials - SDL2 tutorials used in development.
This project is licensed under the MIT License - see the LICENSE file for details.