Skip to content

sponthus/cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3d

Description

Cub3D 42 project badge Cub3D is a 42 school team graphic design project where you need to create a 3D dynamic view in a maze, inspired by Wolfenstein 3D. Coding in C and using the MiniLibX library, an adaptation of the Xlib library, we must implement ray-casting algorithms.

📝 Status

125 grade
Validated 2024-11-28
All bonuses
Outstanding ⭐ ⭐

Features

There are two versions of the program: mandatory part and bonus part.

📙 Mandatory

  • Using ray-casting algorithm and the minilibx library
  • Show different textures depending on the wall orientation (north, south, east, west)
  • Ceiling and floor colors
  • Assets depend on an infile that should be correctly formatted
  • Moving with W, A, S, D and closing with ESC
  • Rotate left and right with arrow

🔥 Bonus

  • Wall collisions
  • Minimap system
  • Doors you can open/close with E
  • Animated sprited
  • Mouse directions : rotating the view in every directions using mouse

⚡ Extra bonuses

  • Pause screen with TAB
  • Settings to change speed, colors
  • Jumping with SPACE
  • Crouching with C
  • Speeding with SHIFT_L

🌀 Clone and compile

Clone the repository and enter it :

git clone https://github.com/sponthus/cub3d
cd cub3d
make

The minilibx library is not included in this repository, the latest version will be cloned while making the project.

🗺️ Maps

The program takes a map file as an argument. It should be correctly formated :

  • .cub format only
  • Every texture file linked (NO, SO, WE, EA) - ex: WE ./path_to_the_west_texture
  • Floor F and ceiling color C, in R,G,B range [0,255] : 0, 255, 255 - ex: F 220,100,0
  • Map should be composed only of :
    0 for empty spaces
    1 for walls
    N, S, W, E for the player start orientation
    In bonus part : D for a door
  • Elements can be mixed and separated with whitespaces

You can find maps in the maps/ directory. Maps in error/ directory are incorrectly formatted. Make sure you use _bonus maps with bonus part only, to avoid an error.

🏃 Run

From the project directory, chose your version of the project, then link the map.

./cub3d maps/basic.cub

or

./cub3d_bonus maps/bonus_doors.cub

🤗 Enjoy !

Made by endoliam and sponthus

About

42 school graphic design project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors