• Goals
• Bonus
• Usage
This project is inspired by the world-famous Wolfenstein 3D game, which was the first FPS ever. In this project, we explore the concepts of ray-casting.
This is the second project in which we use the graphical library miniLibX
, and my new favorite.
The goal is to make a dynamic view inside a maze.
• Smooth window management;
• Display different wall textures that vary deppending on which side the wall is facing;
• Set the floor and the ceiling to two different colors;
• Set the following key binding:
- W A S D to move the point of view through the maze;
- ← and → arrow keys to rotate the camera;
- ESC to close the window and quit the program cleanly, so as the red cross.
• Use of images of the minilibX;
• Validate the map files;
• Print Error\n followed by an explicit error message for invalid maps.
• Wall collision;
• Minimap system;
• Doors which can be open and close;
• Animated sprite;
• Rotate the point of view with the mouse.
It was so much fun doing this project, that I couldn't miss the opportunity to add a few bonuses of my own:
• A NPC;
• A quest with a quest log system;
• Enemies that chase the player until they are defeated;
• HUD bar with multiple menu options, such as:
- Quest log - that updates with the quest progression;
- Inventory - also updated when the quest items are collected;
- Minimap;
- Character information (roleplay only);
- Character status (roleplay only);
- Animated interaction button.
- Shadow applied to walls, sprites, floor and ceiling
• Visual feedback when the player takes damage.
Install its dependencies:
sudo apt-get install gcc make xorg libxext-dev libbsd-dev
Clone minilibx repo:
$ git clone https://github.com/42Paris/minilibx-linux.git
Run the config tool:
./configure
For more details, check miniLibx repository Readme
.
To compile the program, run:
$ make
Execute the program, providing the valid map file path
$ ./cub3d maps/mandatory/vault_map.cub
To compile the program, run:
$ make bonus
Execute the program, providing the bonus map file path
$ ./cub3d_bonus maps/bonus/vault42.cub
Controls:
[W][A][S][D]: move the player
[←][→]: rotate the camera
[Rclick]+[Mouse]: rotate the camera
[E]: interact (use)
[R]: reload ammo
[ESC]: close the game
This group project was made in partnership with Henrique Duller
This work is published under the terms of 42 Unlicense