aIrseneO / cub3d

In this project we create a dynamic 3D view of the inside of a maze using Ray-casting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cub3d

In this project I create a dynamic 3D view of the inside of a maze using Ray-casting. This project is inspired by the worlf-famous eponymous 90's game, which was the first FPS (Fist Person Shooter) ever Wolfenstein 3D.

How to use it?

This project uses a tiny graphics library MinilibX. Systems requirements are specify here.

At the root of the repository run the command

make cub3d

If failure for any missing dependencies, install them and re-run the command. Upon success, an executable file named cub3d will be created. Run the command

# SYSNOPSIS:
# cub3d map [--save]

./cub3d maps/map1.cub

the flag --save is the only flag available, it's used to save the first rendered image of the inside of the maze in a bmp file named screenshot.bmp.

Flag omitted, a window displaying the dynamic 3D projection of the maze will open

Run With Docker

docker build -t cub3d .
docker run -v $PWD:/cub3d cub3d
sudo chown $(id -u):$(id -g) cub3d
Maze view

Use the keyboard as follow to move inside the maze:

up / w to move forward
down / s to move backward
a to move left
d to move right
left to rotate left
right to rotate right
esc to cleanly close and exit the program.

Configurations

The files holding the configuration of the maze is located in the directory maps.

R 948 480
NO textures/wall_1.xpm
SO textures/wall_2.xpm
WE textures/wall_3.xpm
EA textures/wall_4.xpm
S textures/lion.xpm
F 184,113,39
C 51,198,227

   1111111111111111111111111111
  11000000001100000000000000001
  10010000011100000111100010001
  100100000000000201  100010001
1110110000011100000111100010001
1000000000000000000000000000011
100000000011000001111111111111
111101100011110111
   1011001111101 11111111111
1111000011010101110000000001
1000000000000000110000001011
10200000000000001101010010011
111101111001010000200000W0001
10000000001111100000000000111
111000000001  1000010100011
  1111111111  111111111111

About

In this project we create a dynamic 3D view of the inside of a maze using Ray-casting.

License:GNU General Public License v3.0


Languages

Language:C 78.0%Language:Objective-C 13.4%Language:Roff 5.4%Language:Makefile 3.0%Language:Shell 0.1%Language:Dockerfile 0.0%