Skip to content

42 cub3d project - explore ray-casting by building a maze, inspired by Wolfenstein 3D

Notifications You must be signed in to change notification settings

elbaradi/ft_cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: This was my fifth 42 project, completed February 2021. It was my biggest project at the time, it involved a lot of maths to get the graphics right. I had a lot of fun adding extra features to this project, like custom textures, custom screenshots, audio, shading and a hurt system.

Logo

cub3d

This project is a graphic design project, inspired by the famous game Wolfenstein 3D. Creating a "realistic" 3D graphical representation of the inside of a maze from a 2D map, with a first person perspective using Ray-Casting principles.

Technical details

  • Controls: W A S D to move, left and right arrow to change camera angle, ESC or close window to exit program
  • Reads in a .cub map file, with map specifications and 2D map design, which are validated by the program before getting into gameplay
  • Ceiling and floor color is read from the .cub file and can be changed
  • Walls are textured, customs textures can be added and read from the .cub file
  • Distance-based shading
  • Added a soundtrack
  • Custom cactus sprites are added, hurt triggers when walking into them
  • Program exits when the player dies
  • Running the program with --save as an argument takes a screenshot of the first loaded frame and saves it in the screenshot folder
  • All heap allocated memory space is properly freed
  • Allowed functions: open, close, read, write, malloc, free, perror, strerror, exit, all functions of the math library and the MinilibX graphic library

How to run

Run the following commands. This version of the graphic library only works with MacOS. A test map file (test.cub) is provided in the maps directory. Replace test.cub with a .cub file of your choice

$ git clone https://github.com/elbaradi/ft_cub3d
$ make bonus
$ ./cub3d maps/test.cub

Gameplay

ft_cub3d

About

42 cub3d project - explore ray-casting by building a maze, inspired by Wolfenstein 3D

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published