This project, cub3D, is inspired by the iconic first-person shooter game Wolfenstein 3D. It is implemented in C using the raycasting technique to create a 3D graphical representation of a maze-like world from a first-person perspective.
The cub3D project is part of the 42 school curriculum and aims to introduce students to the fundamentals of raycasting, a basic form of 3D rendering, as well as to improve their skills in graphics programming, parsing, and software architecture.
- Basic Raycasting Engine: Renders a 3D perspective of a maze-like environment using raycasting.
- Texture Mapping: Walls are textured with images from external files.
- Basic Game Mechanics: Includes player movement, rotation, and interaction with the environment.
- Error Handling: Checks for and handles various errors gracefully.
- Clone the repository:
git clone https://github.com/your-username/cub3D.git cd cub3D - Compile the project:
make
Run the program with a map file as argument:
./cub3D map/map_level0.cub- W: Move forward
- A: Move left
- S: Move backward
- D: Move right
- Left Arrow: Rotate left
- Right Arrow: Rotate right
- Up Arrow: Move forward
- Down Arrow: Move backward
- ESC: Exit the game
make bonus./cub3D_bonus map_bonus/bonus_map_level1.cub-
Sprite Rendering: Supports sprite objects that can interact with the player.
-
Collision Detection: Prevents the player from moving through walls.
-
Mouse left-click: Additional controls with mouse to increase the immersion
-
Interactive actions: A door opens by pressing SPACE if all the collectibles have been collected
-
Music: Ambiance music