This repository is dedicated to the Cub3D project, inspired by the historic game Wolfenstein 3D, which was the first FPS ever. The challenge of this project is to create a "realistic" 3D graphical representation of the inside of a maze from a first-person perspective, using Ray-Casting principles. The project is part of the 42 school curriculum and aims to explore graphics programming, deepen the understanding of algorithms for computer graphics, and how to deal with complex projects. The bonus part includes features such as collisions, a minimap, and fog of war, enhancing the game experience.
- 3D rendering of a maze using Ray-Casting.
- Texture mapping for walls and sprites.
- Basic controls to move forward, backward, and turn left and right.
- Bonus: Collision detection to prevent walking through walls.
- Bonus: Minimap for navigation.
- Bonus: Fog of war or depth shading to simulate distance visibility.
Cub3D is developed in C and uses the MiniLibX graphics library, with the following dependencies:
- GCC or Clang compiler.
- Make (for compiling).
- MiniLibX library, provided by 42 or installed separately.
- A Unix-based operating system (Linux or MacOS).
To compile the mandatory part of Cub3D, follow these steps:
- Clone the repository to your local machine:
git clone git@github.com:akhellad/Cub3D.git- Navigate to the cloned directory:
cd cub3D- Compile the project:
makeThis will create an executable named cub3D for the mandatory part of the project.
For the bonus features including collisions, a minimap, and fog of war, compile with the following command:
make bonusThis command creates an executable named cub3d_bonus.
To launch Cub3D, run:
./cub3D map.cubFor the bonus version, run:
./cub3d_bonus map.cubReplace map.cub with the path to your map configuration file.
Ensure your map file (map.cub) is correctly formatted according to the project specifications. It should include the layout of the maze, textures for walls and sprites, and settings for ceiling and floor colors.
W,A,S,Dto move the player forward, left, backward, and right.- Left and right arrow keys to rotate the view (or mouse in bonus).
ESCto exit the game.
Here are some screenshots showcasing the gameplay and features of Cub3D:
This project was developed by Akhellad and Hsilverb, students at Ecole 42. The Cub3D project demonstrates a practical application of computer graphics programming, offering an immersive experience in a 3D environment.

