Skip to content

il94/42_cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a 42 School group project. The project consists in creating a small 3D environnement using raycasting with the MiniLibX, the school's graphic library. Some walls are a bit special. If so, a little fairy will let you know ;)

This project has been completed in collaboration with @AntoineDouay.

Commands

W
Move forward
S
Move backward
A
Move left
D
Move right
🡰
Look left
🡲
Look right
SPACE
Open door
TAB
Enable mouse
ESC
Close game

Installation

sudo apt-get install xorg libxext-dev zlib1g-dev libbsd-dev libxcomposite-dev
sudo apt-get install vlc
git clone https://github.com/il94/42_cub3D cub3D
cd cub3D && make -j

Run

./cub3D [MAP.cub]

A default map is provided in the "maps" folder, but you can customize it as you want, so enjoy !

File map composition

First of all, you can choose the images and colors of the rendering

IndexFormat
NOImage in xpm format of 128x128 (north direction)
SOImage in xpm format of 128x128 (south direction)
EAImage in xpm format of 128x128 (east direction)
WEImage in xpm format of 128x128 (west direction)
FImage in xpm format of 512x512 /
RGB value (sky)
CRGB value (floor)

Then the map itself, composed of the following characters

CharacterElement
0Floor
1Wall
2Door (closed)
3Door (opened)
SpaceVoid
NPlayer (looking north)
SPlayer (looking south)
EPlayer (looking east)
WPlayer (looking west)

Example

NO sprites/wall_clouds_2.xpm
SO sprites/wall_clouds_2.xpm
EA sprites/wall_clouds.xpm
WE sprites/wall_clouds.xpm
F 31,163,224
C sprites/wall_stars.xpm

11 10011 1000011 100000011 10000000011 111000000000011 10E0000000000001 111000000000011 10000000011 100000011 1000011 10011 11

To be valid, a map must meet the following conditions :

  • being surrounded by walls
  • containing only one player
  • being composed by only valid characters
  • the file containing map must be .cub

By respecting the conditions above, you can create your own maps !

Informations

All sound effects, scores and sprites come from different Nintendo games. True fans will know ;)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors