Table of Contents
This is the second group project of the 42 core curriculum.
It is inspired by the world-famous Wolfenstein 3D game and is an opportunity to explore the large world of ray-casting.
This project’s objectives are similar to all this first year’s objectives: Rigor, use of C, use of basic algorithms, information research etc.
As a graphic design project, we had to use the 42 graphics library miniLibX.
To conclude cub3D is a remarkable playground to explore the playful practical applications of mathematics.
With the help of the numerous documents available on the internet, you will use mathematics as a tool to create elegant and efficient algorithms.
This project was done in collaboration with Florian Bindereif.
To run the project, OpenGL and AppKit are required for the miniLibX library to work properly.
If you want to run this program on Linux here is a tutorial that might help to install the library on Linux. This was not tested by us, so you may face problems.
- Clone the repo
git clone https://github.com/42sin/cub3D.git && cd cub3D
- Compile the project
make
- Run the program
./cub3D map.cub
- Move your camera with your arrow keys or by dragging with your mouse
- Move the character with
WASD
- Interact with the environment by pressing
Enter
Here is an example
You can change the windows size, movement speed, difficulty, minimap size, etc. inside of srcs/includes/cub3d_defines.h
- minimap
- move the camera by leftclicking and dragging or by pressing the arrow buttons
- pressing
ESC
or clicking the cross of the window closes the program - enemies
- wall collision
- game gets closed when an enemy touches you
- doors that can be opened/closed
- 5 different sprites (barrel, light, pillar, door, animated enemy)
Inside of the repository you are provided with an example map but feel free to change the map to your likings, as long as it is a valid map. You can also change the textures as well inside of textures/
0
define walkable spaces1
define wallsD
define doorsF
defines where the enemy spawnsB
defines barrelsL
defines lightsP
defines pillars- 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
- set all the textures that should be used as wall texture i.e.
WE images/1.xpm
EA images/2.xpm
SO images/3.xpm
NO images/4.xpm
- set the ceiling color, i.e.:
C 0, 183, 183
- set the floor color, i.e.:
F 141, 1, 126
For more information about the specific requirements and tasks, check out the Subject PDF.
Distributed under the MIT License. See LICENSE
for more information.