Cub3D is a simple raycasting engine inspired by the classic Wolfenstein 3D game. This project is part of the 42 curriculum and demonstrates the implementation of a 3D graphical representation of a maze using the raycasting technique.
- Raycasting Engine: Renders a 3D perspective from a 2D map.
- Texture Mapping: Supports different textures for North, South, East, and West walls.
- Floor and Ceiling Colors: Customizable colors for floor and ceiling.
- Player Movement: Smooth movement (WASD) and rotation (Arrow keys or Mouse).
- Map Parsing: Reads
.cubconfiguration files to load maps and settings. - Map Validation: Ensures the map is closed/surrounded by walls and contains valid characters.
- Collision Detection: Prevents the player from walking through walls.
- Minimap: (If implemented) Displays a 2D view of the map.
- C Language: The core implementation language.
- MLX42: A cross-platform graphics library used for window management, rendering, and input handling.
- Libft: A custom C library containing useful standard functions.
-
Clone the repository:
git clone https://github.com/izaydeh/Cub3D.git cd Cub3D -
Build the project:
make
-
Run the game:
./cub3D maps/good/subject_map.cub
(Replace
maps/example.cubwith the path to your map file)
- W / A / S / D: Move the player.
- Left / Right Arrow: Rotate the camera.
- ESC: Exit the game.
| Name | Intra ID | Github |
|---|---|---|
| Ismail Khalil | ikhalil |
izaydeh |
| Mousa Hasoneh | mhasoneh |
mossaJehad |
src/: Source code files.include/: Header files.libft/: Libft library.MLX42/: MLX42 graphics library.maps/: Example map files.textures/: Texture assets.