Cub3D is a 42 school team project to create a dynamic view inside a 3D maze. Using the MiniLibX library, we must implement raycasting in the style of the famous Wolfenstein 3D game, the first true FPS in videogame history.
Clone the repository including the MiniLibX submodule:
git clone https://github.com/Ekkoz897/42cursus_cub3d
There are two versions of the program, the mandatory part and the bonus part. The bonus part adds wall collision, a minimap, and the ability to rotate the view by moving the mouse.
To compile the mandatory part, cd
into the cloned directory and:
make
To run the program:
./cub3D <path/to/map.cub>
The program takes a map file as an argument. Maps are available in the assets/maps
directory. There are good maps which the program should run smoothly with, and bad maps which the program should reject.
Controls for movement and rotation are:
W
: move forwardS
: move backwardA
: strafe leftD
: strafe rightleft arrow
: rotate leftright arrow
: rotate rightmouse
: rotate by moving the mouse (bonus only)
Useful resources for this project are:
- Minilibx: hsmits MiniLibX documentation
- Minilibx: gontjarow's MiniLibX tutorial
- Xlib (for MLX events): The Xlib Manual
- Raycasting: Lode's Computer Graphics Tutorial - Raycasting
- Raycasting: Permadi's Raycasting tutorial
- Movement: Calculating heading in 2d games: Using trigonometric functions part 1
Made by Ratavare and Ekkoz