Cub3D is a 42's School project where the main goal is to make a first-person 3D representation of a maze by using raycasting.
Theoretically it should work on both Linux and MacOS, but... the keybindings and the mlx
seem to differ between these OS.
So for now it only supports Linux
systems.
All tools you might need to build this project:
make
build-essential
(C compilers)wget
xorg
libxext-dev
libbsd-dev
unzip
(Debian/Ubuntu)
sudo apt install make build-essential wget xorg libxext-dev libbsd-dev unzip
To build the program you have just to run:
make
cub3D
requires one argument which should be the file with texture configurations and the actual map.
there are a few sample maps in assets/maps
folder.
E.g.:
./cub3D assets/maps/small.cub
These are the implemented keybindings:
w
: Move forwarda
: Move lefts
: Move backwardsd
: Move right
Up arrow
: Look upDown arrow
: Look downLeft arrow
: Look leftRight arrow
: Look right
ESC
: Quit the game
Space
: JumpLeft Shift
: SprintLeft Control
: SquatLeft Alt
: Guard mode (yeah it's useless but it's beautiful)
The game itself is made entirely in C.
The graphics library used here is a 42's wrapper for Xlib
called mlx
.
Most crazy part is that the whole project (except for mlx
) is wrote by following norminette
's rules... :P