Cub3D is a 3D graphical project built with MiniLibX as part of the 42 School curriculum. It is inspired by the classic Wolfenstein 3D game, designed to showcase 2D raycasting techniques to create a pseudo-3D experience. This project is a fundamental exercise in graphics programming, mathematical computation, and game design.
Cub3D.mp4
- Raycasting Engine: Implements raycasting to simulate a 3D environment based on a 2D map.
- Player Movement: Real-time interaction with smooth player movement and rotation.
- Texture Mapping: Support for walls with textured surfaces for a more realistic look.
- Custom Map Parsing: Load maps from
.cub
files, with configurable layouts and textures. - Minimap: Includes a 2D minimap overlay for better navigation.
- Real-Time Rendering: Dynamic frame updates for an immersive gameplay experience.
- Operating System: Linux or macOS.
- Libraries: MiniLibX, and a working X11 server or macOS display system.
- Clone the repository:
git clone https://github.com/LiLZ4CK/Cub3D.git cd cub3d
- Build the project using Makefile:
make
- Run the game:
./cub3D map.cub
Texture Paths: Specify wall textures (e.g., NO, SO, WE, EA). Colors: Define floor and ceiling colors in RGB. Map Layout: Use characters (0 for empty space, 1 for walls, N/S/E/W for player spawn). Example:
NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm
F 220,100,0
C 255,255,255
111111
100001
1010N1
100001
111111
W/A/S/D: Move forward, backward, left, or right. ←/→: Rotate the player’s view. ESC: Exit the game.
Raycasting Engine: Implements raycasting to simulate a 3D environment based on a 2D map. Player Movement: Real-time interaction with smooth player movement and rotation. Texture Mapping: Support for walls with textured surfaces for a more realistic look. Custom Map Parsing: Load maps from .cub files, with configurable layouts and textures. Minimap: Includes a 2D minimap overlay for better navigation. Real-Time Rendering: Dynamic frame updates for an immersive gameplay experience.