My first RayCaster.
This project is inspired by the world-famous Wolfenstein 3D game, which was the first FPS ever. The goal was to make a dynamic view inside a maze.
from @chris-bbrs and @gjupy
only tested on macOS Catalina (Version 10.15.7)
For all other OS it is not guaranteed to work.
OpenGL and AppKit is required to run it.
Click here for more information about the installation.
- decide which texture is displayed on which side
0
define walkable spaces1
define walls2
define doors- the players position is displayed by:
N
player is facing north (top of the 2D map)E
player is facing east (right side of the 2D map)S
player is facing south (bottom of the 2D map)W
player us facing west (left side of the 2D map)
- the map has to be enclosed by walls on all sides
- doors have to have walls on two opposite sides
- any other characters other than the ones above are forbidden
- if there is a
- only one player position is allowed
- you have to set all the textures that should be used as wall texture i.e.
NO ./textures/path_to_the_north_texture/wall_text.png
SO ./textures/path_to_the_south_texture/wall_text.png
WE ./textures/path_to_the_west_texture/wall_text.png
EA ./textures/path_to_the_east_texture/wall_text.png
- you have to set the ceiling color, i.e.:
C 0, 183, 183
- you have to set the floor color, i.e.:
F 141, 1, 126
- run
make
in the root of the directory - run
./cub3D game.cub
in the root of the directory - move the character with
WASD
- turn the FOV left and right by pressing
arrow_left
andarrow_right
or by moving the mouse right or left
All the visualization is done with the help of the MLX42 library.