Skip to content
/ cub3D Public

Cub3D is a 42 school team project to create a dynamic view inside a 3D maze using raycasting in the style of Wolfenstein3D.

Notifications You must be signed in to change notification settings

mcombeau/cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3D

Cub3D 42 project badge

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.

Status

Validated 12/02/2023. Grade: 115%.

Clone

Clone the repository including the MiniLibX submodule:

git clone --recursive https://github.com/mcombeau/cub3D.git

Or:

git clone https://github.com/mcombeau/cub3D.git
git submodule update --init --recursive

Compile and Run

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 compile the bonus part, cd into the cloned directory and:

make bonus

Note: you may need to make fclean to switch between the mandatory and bonus compilations (working on a fix for this!).

To run the program:

./cub3d <path/to/map.cub>

The program takes a map file as an argument. Maps are available in the maps directory. There are good maps which the program should run smoothly with, and bad maps which the program should reject. For example:

  • ./cub3d maps/good/library.cub should run.

  • ./cub3d maps/bad/filetype_wrong.buc should print an error and abort.

Controls

Controls for movement and rotation are:

  • W: move forward
  • S: move backward
  • A: strafe left
  • D: strafe right
  • left arrow: rotate left
  • right arrow: rotate right
  • mouse: rotate by moving the mouse (bonus only)

Useful Resources

Useful resources for this project are:


Made by aquesada and mcombeau