Cub3D is a captivating 3D maze exploration game created as part of the 42 school curriculum. This project tasked us with recreating the iconic first-person view of Wolfenstein 3D using raycasting techniques, challenging our skills in graphical programming and algorithmic problem-solving.
At its heart, Cub3D converts a 2D map into a 3D interactive environment, providing players with a realistic sense of depth and perspective. Navigate through corridors, rooms, and open areas, all dynamically rendered in real-time through sophisticated mathematical computations and efficient coding.
We have exceeded the basic requirements by incorporating a dynamic minimap for better navigation, elevating the gameplay experience significantly. This project not only hones programming skills but also requires a deep understanding of graphics rendering, spatial awareness, and optimization strategies. It merges mathematics, physics, and computer science into a compelling gaming experience.
- Realistic 3D perspective rendering leveraging advanced raycasting techniques
- Textured walls with distinct textures for each cardinal direction
- Smooth player movement and intuitive camera rotation
- Accurate collision detection to ensure game integrity
- Dynamic Minimap: Provides a real-time 2D view of the maze for improved navigation
- Extensive customization options in the settings file, including colors, screen size, and raycaster parameters
- Ability to upload custom images for wall textures and create custom maps, with automatic validation checks
- C programming language for robust and efficient code
- MinilibX graphics library for rendering and window management
- Raycasting algorithms for 3D perspective rendering
- File parsing techniques for map creation and validation
gcccompilerMake
Clone the repository:
git clone git@github.com:42OK42/Cubed3D.gitNavigate to the project directory:
cd cub3dCompile the project:
makeRun the executable with any map file from the resources folder, for example:
./cub3D resources/valid_map_1.cub- W/A/S/D: Move the player through the maze
- Left/Right arrow keys: Rotate the camera view
- ESC: Exit the game
The settings file allows you to customize various aspects of the game, including:
- Minimap settings
- Colors
- Screen size
- Number of rays for the raycaster
You can also upload your own images for wall textures and create custom maps. The system automatically checks these maps for validity.
.cubextension- Texture paths for North, South, East, and West walls
- Floor and ceiling colors (RGB format)
- Map layout using characters:
0: Empty space1: WallN/S/E/W: Player starting position and orientation
- 42 School for providing the challenging project requirements and resources
- The creators of Wolfenstein 3D for the original inspiration
- Raycasting tutorial by 3DSage for invaluable insights
- Special thanks to my teammate Damian, whose dedication, ideas, and collaborative spirit were crucial in bringing this project to life.