Graphic project with use of miniLibX.
This project is inspired by the world-famous Wolfenstein 3D game. It aims to explore ray-casting. The goal is to make a dynamic view inside a maze, in which the player has to find the way.
โข The left and right arrow keys of the keyboard allow to look left and right in the maze.
โข The W, A, S, D keys allow to move the point of view through the maze.
โข Pressing ESC and red cross of window close the window and quit the program.
All maps are stored in maps
directory
The map itself is composed of 6 characters:
0
for an empty space1
for a wallN
,S
,E
orW
for the playerโs start position and spawning orientation
You can create your own map using the combination of characters mentioned above.
- Map should be surrounded by wall and must not have empty lines.
To validate the map we used flood-fill algorithm
โข The minimap is displayed in the top left corner with player moving as you press the keys.
The project can be compiled on both Mac OS and Linux.
make && ./cub3D maps/choose_your_map
make && ./cub3D maps/irregular.cub
or
./cub3D maps/lab.cub
Raycasting
๐ Lode's Computer Graphics Tutorial - Raycasting
๐ ะะฑััะตะฝะธะต ัะตั ะฝะพะปะพะณะธะธ ray-casting, ัะฐััั 1
Map validation
๐ How can I tell if an object in a tile grid is surrounded?
๐ Flood fill algorithm