Cub3D is a project that aims to create a 3D game using the raycasting technique. The project was developed using the C language and the Codam 42MLX library.
The Game is inspired by the world-famous game Wolfenstein 3D
, which was developed by id Software in 1992.
The Game is a maze game where the player has to find the exit while avoiding the enemies.
you can fight the enemies using the gun that you have, but be careful, you have limited ammo.
The project was developed and tested on a macOS system, and it may not work on other operating systems.
Pre-requirement
if you are in a macOS you need to have gltw
you can install it using brew:
brew install glew
- Clone the repository
git clone https://github.com/abouabra/42-Cub3D.git
- Navigate to the project folder
cd 42-Cub3D
- Run the make command
make
- Run the game
./cub3D maps/bonus.cub
The game has a few maps that you can play, you can find them in the maps
folder.
You can also create your own map and play it using the game.
The game can be closed by pressing the 'esc' key or by clicking the red cross on the window.
The map is a simple text file with the following characters:
1
for the wall0
for the empty spaceN
,S
,E
,W
for the player's starting position and direction
The player can move using the WASD keys. shooting is done by pressing the space key. you can move the camera using the arrow keys or the mouse.
If you have any suggestions or improvements, feel free to open an issue or submit a pull request.