A 3D maze exploration game built in C using ray casting and the MinilibX graphics library.
- Prerequisites
- Running the Game
- Game Controls
- Project Structure
- Cleaning Up
- Troubleshooting
- Contributors
- Compiler: GCC or Clang
- Build Tool: Make
- Libraries: X11 development libraries
Required Libraries: The following development packages must be installed:
libx11-dev- X11 client library development fileslibxext-dev- X11 miscellaneous extension library development files
Install Dependencies:
sudo apt-get update
sudo apt-get install -y libx11-dev libxext-devOn other Linux distributions:
- Fedora/RHEL:
sudo dnf install libX11-devel libXext-devel - Arch:
sudo pacman -S libx11 libxext
Main Version
./cub3D maps/map_m.cubBonus Version
./cub3D_bonus maps/map_b.cub- W - Move forward
- A - Strafe left
- S - Move backward
- D - Strafe right
- Left Arrow - Rotate camera left
- Right Arrow - Rotate camera right
- Up Arrow - Move forward
- Down Arrow - Move backward
- Mouse - Look around (bonus version)
- x - Wave the weapon (bonus version)
- g - Call granny (bonus version) "it works only after the player moved from its initial position"
- SPACE - open the door (bonus version)
- ESC - Exit game
.
├── cube.h / cube_bonus.h - Header files
├── main.c / bonus/main_bonus.c - Entry points
├── minilibx-linux/ - Graphics library
├── maps/ - Game maps
├── textures/ - Game textures
└── [various .c files] - Source code modules
# Remove object files
make clean
# Remove object files for bonus
make clean_bonus
# Full cleanup
make fclean
# Full cleanup for bonus
make fclean_bonus- Make sure you've compiled MinilibX:
cd minilibx-linux && make && cd .. - Update your Makefile with
-I./minilibx-linuxflag
- Install X11 development libraries:
sudo apt-get install libx11-dev libxext-dev
- This is normal on headless systems without X11 display server
- Try using Xvfb if you need to run on a headless server:
sudo apt-get install xvfb xvfb-run ./cub3D maps/map_m.cub
This project was developed by:
Created as part of the 42 School curriculum.