Skip to content

yumi8748/cub3d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to YU-CHEN and LMORAN's CUB3D

🏰This is our version of Cub3D, a project at 42 PARIS which consists in using raycasting and rendering to create a simple 3D game similar to Wolfenstein 3D.

🎮 Game Overview

We use the MinilibX a simple X-Window programming API in C to render our game, thus it is recommended to use a MAC or LINUX machine to compile the game.

We use the DDA method for our raycasting process, which is a simple but fast algorithm which uses square grids to calculate distances from the player to the objects (walls) in a 2D space. With this system, it is virtually impossible to have walls of different sizes, stairs, etc, but in the case of our project it made the program easy to implement.

To access our bonuses (wall collisions, animations, and a simple minimap), compile with make bonus. To get the base game back, make re.
⚠️If you encounter the following error during make compilation:
/usr/bin/ld: cannot find -lXrandr: No such file or directory  
/usr/bin/ld: cannot find -lXi: No such file or directory  
Run these commands to install the required X11 libraries:
sudo apt update  
sudo apt install libxrandr-dev libxi-dev  

🎮Controls

W S to move FORWARD and BACK
A D to strafe LEFT and RIGHT
<- -> arrow keys to look LEFT and RIGHT
HOLD LSHIFT to SPRINT (limited gauge that needs to replenish)
ESC to EXIT
F in BONUS version to FIRE

PARSING AND MAP CREATION

Any map can be used, so long as it fits the following criteria:

It MUST contain paths to textures (XPM FILES) for the walls facing each direction, such as:

NO path_to_texture.xpm  
SO path_to_texture.xpm  
EA path_to_texture.xpm  
WE path_to_texture.xpm  

For the best experience, use 64x64px xpm images.

It MUST contain the RGB values for the ceiling and floor, such as:

F 188,106,60 (brown)
C 173,216,230 (light blue) 

The map MUST be closed, and contain ONE player character. The player can face whatever direction is chosen by using N,S,W,E characters. Walls are '1' and empty spaces are '0', such as:

11111111  
10111001  
10001111  
11S01 1  
 111111  

In this example map, the player will be facing North when the game launches. This map is valid, as the map is closed and contains a player, even if there is an inaccessible room, and an empty area inside the map.
TABs cannot be used for spaces in the map creation, only SPACEs.

Have fun!

image image image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 93.2%
  • Makefile 6.8%