Skip to content

Building a game inspired by Wolfenstein 3D using MiniLibX library

Notifications You must be signed in to change notification settings

joekeroo/42-cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-cub3d

In this project, we created a game inspired by Wolfenstein 3D.
The program reads from a map and displays a maze with a dynamic view using an algorithm by Lode Vandevenne.
For bonus, we implemented an animated torch with lighting, mouse control, wall collisions, minimap and doors.

Game demo

About

  • You must use MiniLibX. Either the version available on the school machines, or installing it using its sources.
  • The program will take a map as an argument.
  • Map file extension must end with .cub.
  • Display different wall textures that vary depending on which side the wall is facing.
  • Must be able to set floor and ceiling colors to 2 different colors.
  • W, A, S, D keys must control the player movement.
  • ESC key will exit the game.
  • The use of images of the MiniLibX is strongly recommended.

Installation & Usage

  • GNU make (v3.81)
  • GCC (v4.2.1)
  • MiniLibX

Building the program

  1. Download/Clone this repository
git clone https://github.com/joekeroo/42-cub3d.git cub3d
  1. cd into the root directory and run make
cd cub3d && make

Compilation

  • make - compiles the program into cub3d
  • make clean - removes all .o files
  • make fclean - clean and removes cub3d
  • make re - fclean and recompiles

Run the Program

./cub3d test_maps/small.cub

Controls

Characters Description
W move forwards
A move to the left
S move backwards
D move to the right
Q Equip and unequip torchlight
E Interact
C Crouch
H Toggle between mouse view and arrow key view
left arrow look left
right arrow look right

Map Requirements

  • The map can be composed of only these 6 characters:
Characters Description
0 an empty space
1 a wall
N the player’s starting position facing North
S the player’s starting position facing South
E the player’s starting position facing East
W the player’s starting position facing West
  • The map must be closed/surrounded by walls. If it’s not, the program must return error.
  • Except for the map content, each type of element can be separated by one or more empty line(s).
  • Except for the map content which always has to be the last, each type of element can be set in any order in the file
  • Except for the map, each type of information from an element can be separate by one or more space(s).
  • Any kind of maps will be accepted as long as it respects the above rules.
  • Each element (except the map) firsts information is the type identifier (composed by one or two character(s)), followed by all specific informations for each object in a strict order such as:
Type Identifier Map Syntax
North Texture NO NO ./path_to_north_texture
South Texture SO SO ./path_to_south_texture
West Texture WE WE ./path_to_west_texture
East Texture EA EA ./path_to_east_texture
Floor Color F F 220,100,0
Ceiling Color C C 225,30,0
  • Example of a valid map:
map

Contributors

About

Building a game inspired by Wolfenstein 3D using MiniLibX library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published