cub3d is a project from the 42 school using raycasting, inspired by the most well known game that used this technique, is of course Wolfenstein 3D.
- ๐จโ๐ซ Quick demonstration
- ๐ Table of Contents
- ๐ฆ Installation
- ๐ Usage
- ๐ Example
- ๐ References
mandatory-resized.mp4
Short demonstration for the mandatory part, running on the subject map
./maps/good/subject_map.cub
.
bonus-resized.mp4
Short demonstration for the bonus part, running on the subject map
./maps/good/subject_map.cub
.
Clone the repository from GitHub:
git clone https://github.com/okbrandon/cub3d.git
Compile the cub3d
's mandatory executable:
make
Compile the cub3d
's bonus executable:
make bonus
Note
If you're on Linux, you'll need to install some libraries first.
Run the cub3d
executable:
./cub3d map_name.cub
On the mandatory part, you'll be able to move with
W
,A
,S
andD
keys, and rotate the camera with theโ
andโ
keys. On the bonus part, you'll be able to move withW
,A
,S
andD
keys, rotate the camera with theโ
andโ
keys, but also using the mouse.
Note
You can find some maps in the maps
directory. (Special thanks to mcombeau for the maps and textures)
You can also create your own maps in the same format as the ones in the directory.
If you want to insert a door in your map, you'll need to add a C
for a closed one or a O
for an opened one in your map file, like this:
1111111111111111111111111
1000000000010001000000001
1000000000010001000000001
100E0000000C000O000000001
1000000000010001000000001
1000000000010001000000001
1111111111111111111111111
Note
The E
is the player's spawn point, and the C
is the door's spawn point.
To open the door in-game, you have to look at it and press O
. To close it, press C
.
If you want to insert our animated sprite in your map, you'll need to add a X
in your map file, like this:
1111111111111111111111111
1000000000010001000000001
1000000000010001000000001
100E0000X0000000000000001
1000000000010001000000001
1000000000010001000000001
1111111111111111111111111
Note
The E
is the player's spawn point, and the X
is the sprite's spawn point.
Warning
The sprite and the door only work on the bonus part.
bsoubaig - bsoubaig@student.42nice.fr evmorvan - evmorvan@student.42nice.fr