A 3D maze renderer using raycasting techniques inspired by Wolfenstein 3D
Cub3D is a graphics project that implements a simple 3D game engine using raycasting techniques. The project renders a 3D maze from a 2D map, allowing players to navigate through the environment with a first-person perspective. It's inspired by the groundbreaking game Wolfenstein 3D and developed as part of the 42 school curriculum.
- ✅ Textured walls with different textures for each wall direction (North, South, East, West)
- ✅ Player movement (forward, backward, left, right) and camera rotation
- ✅ Collision detection with walls
- ✅ Map parsing from configuration files (.cub)
- ✅ Customizable resolution and textures
- ✅ Minimap display
- ✅ Animated sprites
- ✅ Openable doors
- Clone the repository:
git clone https://github.com/ondbeh/cub3d.git
- Navigate to the project directory:
cd cub3d
- Compile the project:
make
- GCC compiler
- Make
- MLX42 library (included ad a submodule)
- X11 libraries (for Linux) or Cocoa (for macOS)
Run the program with a map file:
./cub3d maps/map.cub
The .cub
file should contain:
Symbol | Description |
---|---|
1 |
Wall |
0 |
Walkable space |
NSEW |
Player starting position |
D |
Door (closed) |
|
Empty space (not walkable) |
This project is licensed under the MIT License - see the license file for details.