Welcome to Cub3D! This project is a 3D game engine inspired by the classic Wolfenstein 3D. It is written in C using the MLX42 graphical library and serves as an introduction to basic raycasting techniques and 3D rendering.
- Raycasting Engine: Implements a basic raycasting algorithm to render 3D projections from a 2D map.
- Textures: Supports textured walls for a more immersive experience.
- Map Parsing: Reads and parses a
.cubfile to load the game map, player start position, and other configurations. - Player Movement: Implements smooth player movement, including walking and turning, in a 3D environment.
- Basic Collision Detection: Prevents the player from walking through walls and out-of-bound areas.
- Configurable Settings: Customizable game settings through the map file, including textures, and more.
To compile and run Cub3D, follow these steps:
-
Clone the repository:
git clone https://github.com/dvan-kle/cub3d.git
-
Navigate to the project directory:
cd cub3d -
Compile the project using the provided Makefile:
make
-
Run the game:
./cub3D map.cub
Replace
map.cubwith the path to your map file.
Cub3D requires a valid .cub map file to run. The map file should define the layout of the game world, textures, and other settings. Here's an example of how to run the game:
./cub3D maps/level1.cub- W / Up Arrow: Move forward
- S / Down Arrow: Move backward
- A / Left Arrow: Strafe left
- D / Right Arrow: Strafe right
- Left Arrow: Turn left
- Right Arrow: Turn right
- ESC: Exit the game