A simple raycasting engine in C
"Cub3D" is a project inspired by the iconic game Wolfenstein 3D, one of the pioneers of first-person shooter (FPS) games developed in the early 90s. The project's primary goal is to create a pseudo 3D view using the raycasting method to render a 2D map loaded from a file. It serves as a foundational framework for future game development projects.
This raycasting engine is designed to work on MacOS and Linux platforms.
- Clone the repository and initialize submodules:
git clone https://github.com/lsileoni/cub3d.git && \
cd cub3d && \
git submodule update --init --recursive
- Build the project:
make
- Run the program with a map file (e.g., "subject_example.cub"):
./cub3D maps/subject_example.cub
Once the program is running, users can interact with it as follows:
- Use
W
,S
,A
, andD
keys to move forward, backward, left, and right, respectively. - Utilize the arrow keys or the mouse to rotate the view left or right.
- Press
ESC
to exit and quit the program.
Here's a glimpse of what the program looks like in action:
This project was implemented entirely in the C programming language and relies on the following libraries:
-
MLX42: A minimalist graphics library that interfaces with the X-window system and leverages GLFW and OpenGL under the hood for graphics rendering. You can find MLX42 here.
-
LibFT: Our custom standard library that provides various utility functions used in the project.