A network 42 project inspired by the world-famous game Wolfenstein3D. With as goal of the project a exploring raycasting and working with a very basic graphics library.
-
Clone this git repository
git clone https://github.com/salbregh/CUB3D.git
-
Go into the root of the directory
cd CUB3D
-
Run the make command, which will compile the source code
make
-
To execute the program you need type in the executable name followed by a .cub file, this file consists a map.
./cub3D map.cub
The program will open in a new window. Here you will be able to walk around in the map.
Use the left and right arrow to rotate the view of the player.
Use the WASD keys to move the player forwards, back, left and right.
A big part of this program is to validate the map before parsing. The following rules must be applied:- the map must be composed of only 7 possible characters: 0 for empty space, 1 for a wall, 2 for sprits (objects) and N S E or W for the player's start position
- the map must be surrounded by walls * except for the map content, each type of element can be seperated by one or more empty lines
- except for the map content which always has to be last, each type of element can be set in any order in the file
- Except for the map, each type of information from an element can be separatedby one or more space
- Each element (except the map) firsts information is the type identifier, followed by all specific informations for each object in a strict order such as :
NO ./path_to_north_texture
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
If this occurs, install the following:
xcode-select --install