"My first RayCaster with miniLibX"
Cub3D is a project of the mandatory part of the cursus. It's only made in C and the main goal was to recreate the first FPS, Wolfenstein 3D. This game is using raycasting render to create a 3D illusion.
It will first check the arguments (only one / or two are allowed) :
- The first one is the map file with all the config informations (mandatory)
- The second one is '--save' if you want to save as a BMP file the first rendered image with raycasting.
The program will then parse the config file, initiate several structures with player's informations and load textures / sprites. Then it will refresh continually the screen thanks to a raycasting algorithm, creating a different image each time the player is moving / rotating / shooting...
The game handles the following events :
- Level choiche (1/2/3 keys, not numeric touchpad)
- Player movements (with WASD keys)
- Player rotation (with arrow keys OR mouse if M key is pressed)
- Shooting (spacebar key)
- Doors interaction (when E key is pressed near a door / secret door)
- Textures rendering or not (when T key is pressed)
- Exit (when ESC key is pressed)
Player can gains life with health items, loses life when ennemy shoots at him. The differents difficulty levels will change ennemy damages. If the player lost his 3 lifes, gameover will occur and he will need to quit the game with ESC key.
- Here is the subject
This project was code for MACOS
-
Download/Clone this repo
git clone https://github.com/lucaslefrancq/42_cub3D.git
-
cd
into the root directory, and runmake
cd 42_cub3D make
-
Run
./cub3d map.cub
to launch the game. You can run./cub3d map.cub --save
if you want to save the first image rendered by the game as BMP.