Skip to content

๐ŸŽฎ 3D perspective game in a 2D map using raycasting. Inspired by Wolfenstein 3D.

Notifications You must be signed in to change notification settings

okbrandon/cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

73 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ cub3d

cub3d is a project from the 42 school using raycasting, inspired by the most well known game that used this technique, is of course Wolfenstein 3D.

Top used language Norminette run GitHub last commit

๐Ÿ“š Table of Contents

๐Ÿ‘จโ€๐Ÿซ Quick demonstration

mandatory-resized.mp4

Short demonstration for the mandatory part, running on the subject map ./maps/good/subject_map.cub.

bonus-resized.mp4

Short demonstration for the bonus part, running on the subject map ./maps/good/subject_map.cub.

๐Ÿ“ฆ Installation

Clone the repository from GitHub:

git clone https://github.com/okbrandon/cub3d.git

Compile the cub3d's mandatory executable:

make

Compile the cub3d's bonus executable:

make bonus

Note

If you're on Linux, you'll need to install some libraries first.

๐Ÿ“ Usage

Run the cub3d executable:

./cub3d map_name.cub

On the mandatory part, you'll be able to move with W, A, S and D keys, and rotate the camera with the โ† and โ†’ keys. On the bonus part, you'll be able to move with W, A, S and D keys, rotate the camera with the โ† and โ†’ keys, but also using the mouse.

Note

You can find some maps in the maps directory. (Special thanks to mcombeau for the maps and textures) You can also create your own maps in the same format as the ones in the directory.

๐Ÿ“ Example

If you want to insert a door in your map, you'll need to add a C for a closed one or a O for an opened one in your map file, like this:

1111111111111111111111111
1000000000010001000000001
1000000000010001000000001
100E0000000C000O000000001
1000000000010001000000001
1000000000010001000000001
1111111111111111111111111

Note

The E is the player's spawn point, and the C is the door's spawn point. To open the door in-game, you have to look at it and press O. To close it, press C.

If you want to insert our animated sprite in your map, you'll need to add a X in your map file, like this:

1111111111111111111111111
1000000000010001000000001
1000000000010001000000001
100E0000X0000000000000001
1000000000010001000000001
1000000000010001000000001
1111111111111111111111111

Note

The E is the player's spawn point, and the X is the sprite's spawn point.

Warning

The sprite and the door only work on the bonus part.

๐Ÿ“Ž References

โฌ† Back to Top

๐ŸŒ Meta

bsoubaig - bsoubaig@student.42nice.fr evmorvan - evmorvan@student.42nice.fr

About

๐ŸŽฎ 3D perspective game in a 2D map using raycasting. Inspired by Wolfenstein 3D.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published