cub3D is a 3D maze game built using raycasting technology, inspired by the legendary Wolfenstein 3D game. This project is part of the 42 School curriculum, demonstrating advanced graphics programming concepts and game development fundamentals.
- 🎥 First-person 3D visualization using raycasting
- 🏃♂️ Smooth player movement (W, A, S, D keys)
- 🔄 View rotation (arrow keys)
- 🎨 Textured walls with different textures for each direction (N, S, E, W)
- 🎪 Customizable floor and ceiling colors
- 🗺️ Custom map format support (.cub files)
- 🖥️ Clean window management
- 💥 Wall collision detection
- 🗺️ Dynamic minimap system
- 🚪 Interactive doors
- 🎬 Animated sprites
- 🖱️ Mouse-controlled camera rotation
# Clone this repository
git clone https://github.com/yourusername/cub3d.git
# Navigate to the project directory
cd cub3d
# Compile the project
make
# Run with a map
./cub3D maps/example.cub
Key | Action |
---|---|
W | Move forward |
S | Move backward |
A | Strafe left |
D | Strafe right |
← | Rotate camera left |
→ | Rotate camera right |
ESC | Exit game |
Mouse | Camera rotation (bonus) |
E | Interact with doors (bonus) |
Maps use the .cub
extension and follow this format:
NO ./path_to_north_texture
SO ./path_to_south_texture
WE ./path_to_west_texture
EA ./path_to_east_texture
F 220,100,0
C 225,30,0
111111111111
100000000001
100000000001
100000N00001
111111111111
0
: Empty space1
: WallN/S/E/W
: Player start position and orientationD
: Door (bonus feature)
- C programming language
- MinilibX graphics library
- Math library
- Raycasting technique
cub3D/
├── src/ # Source files
├── includes/ # Header files
├── assets/ # Textures and maps
├── libft/ # Custom library
└── maps/ # Game maps
- Average FPS: XX
- Memory Usage: XX MB
- Load Time: XX ms
- 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
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Wolfenstein 3D for inspiration
- 42 School for the project specification
- MLX Library Documentation
- Raycasting Tutorial
Hugo Marta - @SirAlabar
Markos Santos - @MarkosComK
Project Link: https://github.com/SirAlabar/cub3D
Made with ❤️ by @hluiz-ma and @marsoare