Skip to content

dpiza/cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cub3D

42-BadgeC-Badge42UnlicenseDenny's 42Project Score

Description

Goals

Mandatory

Bonus

Extra Features

Requirements

Usage

Contribution

Description

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.

Goals

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.

Mandatory

• 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.

Bonus

• Wall collision;

• Minimap system;

• Doors which can be open and close;

• Animated sprite;

• Rotate the point of view with the mouse.

Extra Features

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.

Requirements

Minilibx

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.

Usage

Mandatory

To compile the program, run:

$ make

Execute the program, providing the valid map file path

$ ./cub3d maps/mandatory/vault_map.cub

Bonus

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

Contribution

This group project was made in partnership with Henrique Duller

License

This work is published under the terms of 42 Unlicense