cub3D
is inspired by Wolfenstein 3D, the first ever first-person shooter. The goal of this project is to implement a dynamic view inside a maze from a first person perspective by utilizing ray-casting. It is obligatory to use miniLibX
, a graphics library developed by 42Network.
It is necessary to provide a .cub
file to compile the game. The program takes it as a first argument. The file contains the following information:
Identifier | Description | Example |
---|---|---|
NO | North-facing wall texture path | NO ./path_to_the_north_texture |
SO | South-facing wall texture path | SO ./path_to_the_south_texture |
WE | West-facing wall texture path | WE ./path_to_the_west_texture |
EA | East-facing wall texture path | EA ./path_to_the_east_texture |
F | Floor colour in RGB format | F 220,100,0 |
C | Ceiling colour in RGB format | C 225,30,0 |
1111 1001 1N01 1111 |
A closed map (surronded by walls). It must be composed of only 4 possible characters: 0 for an empty space, 1 for a wall, 2 for a sprite (bonus) and N , S , E or W for the playerβs start position and spawning orientation. |
1111111111111111111111111 1000000000110000000000001 1011000001110000000000001 1001000000000000000000001 11111111101100000111111111111 100000000011000001110111111111111 11110111111111011100000012001 11110111111111011101010010201 11000000110101011100000010001 10000000000000001100000000001 10000000000000001101010010001 11000001110101011111011110N0111 11110111 1110101 101111010001 11111111 1111111 111111111111 |
Identifier | Description | Example |
---|---|---|
S | Sprite texture path (bonus) | S ./path_to_the_sprite_texture |
R | Game window resolution (optional) | R 1920 1080 |
Run the following in the root directory:
make
./cub3D map.cub
- ????
- PROFIT!!!