Cub3D is a small 3D game engine developed as part of the 42 curriculum.
The goal of the project is to create a basic first-person view using a raycasting algorithm, inspired by early 3D games like Wolfenstein 3D.
Basic gameplay showing player movement and the raycasting rendering.
Cub3D allows the use of different wall textures.
Below is an example using an alternative texture set.
Each wall direction (North, South, East, West) can have its own texture.
The ceiling and floor colors can also be customized through the .cub configuration file.
- Raycasting-based rendering
- Textured walls
- Keyboard movement and camera rotation
- Custom
.cubmap parsing - Wall collision detection
- Configurable floor and ceiling colors
- Player spawn and orientation
| Key | Action |
|---|---|
| W | Move forward |
| S | Move backward |
| A | Move left |
| D | Move right |
| ← / → | Rotate camera |
| ESC | Exit game |
Clone the repository:
git clone https://github.com/username/cub3d.git
cd cub3dCompile the project:
makeRun the program:
./cub3D maps/map.cubThe program uses .cub configuration files to define textures, colors, and the map layout.
Example:
NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm
F 220,100,0
C 225,30,0
111111
100001
10N001
100001
111111
- The map must be surrounded by walls (
1) - Player position is defined by:
NSEW
0represents empty space1represents walls
- C
- MiniLibX
- Raycasting algorithm


