Cub3d is a 3D game project developed as part of my 42 curriculum. It is inspired by Wolfenstein 3D (or Doom) and implements raycasting techniques to create an immersive gaming environment.
I recommend playing the bonus version since it’s the main project but improved!
It’s worth noting that we completed this project in approximately three weeks. While the result is satisfying, some planned features were abandoned due to time constraints (we wanted to move on to another project).
These include randomizing the walls, correctly displaying doors, enemies, or bullet impacts.
- Loading maps from text files (Manda)
- 3D rendering engine using raycasting (Manda)
- Player movement (Manda)
- Camera rotation (Manda)
- Collision detection with walls (Bonus topic)
- Mini-map showing player position (Bonus topic)
- Mouse control gameplay (POV and Shoot) (Bonus topic/personal)
- Doors (Bonus topic)
- Stamina (Personal bonus)
- Menu + Settings (Personal bonus)
To install and run Cub3d, follow these steps:
-
Clone the Git repository:
git clone https://github.com/Misthaa/cub3D.git cub3d cd cub3d -
Compile the project:
make
-
With Bonus:
make make bonus
-
Run the game:
./cub3d assets/maps/map_manda/bonus.cub
Use the following keys to play the game:
- W: Move forward
- S: Move backward
- A: Move left
- D: Move right
- Shift: Run
- Left Arrow: Rotate camera left
- Right Arrow: Rotate camera right
- Escape: Quit the game/Menu
- Mouse: Rotate camera left/right
- Left Click: Shoot
Cub3d requires the following dependencies:
- OS: Does not work correctly on macOS.
- Vulkan: This mlx (MacroLibx) depends on Vulkan to function.
- gcc: The C compiler.
Make sure these dependencies are installed before compiling the project.
- Mathis (madegryc), 42 Angouleme. [https://github.com/Misthaa]
- Emile (ehalliez), 42 Angouleme. [https://github.com/Ehlzz]