Dive headfirst into the world of 3D mazes. Clone the repository, follow the getting started guide, and embark on your journey !
SDL2 and SDL2_image are required to compile and use this program
git clone https://github.com/G-omar-H/3D-Maze-Game.git
cd 3D-Maze-Game
make -f Makefile
- Run the MazeGame :
./TheMaze
- Enjoy!
Custom maps can be created by editing the text files in the maps
directory. The map files are parsed by the program and used to draw the maze.
To run the maze with a custom map:
./TheMaze maps/<map_name>
- Disable textures:
./TheMaze no_tex
or./TheMaze maps/<map_name> no_tex
This 3D maze uses raycasting to draw the maze walls, utilizing LodeV's method of using vectors to calculate ray length. By default the maze uses textures but textures can be disabled on execution.
W
: move forwardS
: move backwardA
: rotate camera leftD
: rotate camera rightQ
: strafe leftE
: strafe rightF
: toggle fullscreenESC
: quit
The maps are defined in 2D arrays in text files, which are parsed when passed as an argument to the maze executable. 0
represents open space, all other integers are drawn as different wall's types.
Example:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 2 2 2 2 2 0 0 0 0 3 0 3 0 3 0 0 0 1
1 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 2 0 0 0 2 0 0 0 0 3 0 0 0 3 0 0 0 1
1 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 2 2 0 2 2 0 0 0 0 3 0 3 0 3 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 0 4 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 0 0 0 0 5 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 0 4 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 0 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
- Improved map parser
- Better error handling
- More textures
- Enemies / obstacles / objects
- Maze goal that loads next map
- Rain
- SDL2 API
- LazyFoo Beginning Game Programming
- Ray-Casting Tutorial For Game Development And Other Purposes by F. Permadi
- LodeV Raycasting Tutorial
- Game Engine Black Book
Feel free to contact me at [email protected] with any questions or suggestions.
This project is licensed under the MIT License - see the LICENSE file for details!