Skip to content
/ Cub3D Public

🎮 "Step into a pixelated world of adventure! Cub3D brings the retro charm of raycasting to life, inspired by the legendary Wolfenstein 3D. Navigate mazes, dodge walls, and experience the thrill of building your own 3D engine from scratch."

Notifications You must be signed in to change notification settings

Rpepi/Cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔫 42-Cub3d

GitHub code size in bytes Code language count GitHub top language GitHub last commit

💡 About the project

My first RayCaster with miniLibX

This project is inspired by the world-famous Wolfenstein 3D game, which was the first FPS ever. It will enable you to explore ray-casting. Your goal will be to make a dynamic view inside a maze, in which you’ll have to find your way.

⚡ Raycasting

Raycasting simulates a 3D environment by casting rays from the player’s viewpoint to detect objects and walls. It calculates the distance and angle of each ray to render a corresponding vertical slice, creating the illusion of depth and perspective.

🚀 Running the game

🌟We use personnaly the MLX42🌟

Linux (you need Xlaunch or equivalent if you are in wsl on windows ❗)

sudo cmake MLX42 -B MLX42/build; cd MLX42/build; sudo make; cd ../..; sudo apt-get install mpg123
make run

MacOS (You need to use brew)

make run

This will launch the previously compiled project with make and execute it.

💻 Configurating the map


It will allow you to setup the following parameters :

  • NO -- define the north texture
  • SO -- define the south texture
  • WE -- define the west texture
  • EA -- define the east texture
  • DO -- define the door texture
  • F -- define the floor color (rgb)
  • C -- define the ceiling color (rgb)

F 0,0,0 C 80, 0, 0

Then you can put a valid map

A valid map has one player, all floors are surrounded by walls (1)

        1111111111111111111111111
        1000000000110000000000001
        1011000001110000000000001
        1001000000000000000000001
111111111011000001110000000000001
10000010001100000111D111111111111
111101 111111101110001001000111111
111101111111110111011 10000000001
1100000011010101110001001000111111
10000000000000001100000010001
10000000000000001101010010001
11000001110101011111011110N0111   111
11110111 1110101 101111010001     101
11111111 1111111 111111111111     111

📜 Key and features

  • W A S D -- Used to move the player

  • MOUSE / RIGHT LEFT -- Used to change the direction of the player

  • ESPACE -- Used to fire

  • ESCAPE / RED CROSS -- Quit the program cleany

  • MINIMAP -- Minimap follow the player and rotate in 360°

  • WALL COLLISION -- You can't walk through a wall

  • MUSIC -- Handsome ambient music


This group project was done by MVPee (mvan-pee) and Nour Echaara (nechaara)

About

🎮 "Step into a pixelated world of adventure! Cub3D brings the retro charm of raycasting to life, inspired by the legendary Wolfenstein 3D. Navigate mazes, dodge walls, and experience the thrill of building your own 3D engine from scratch."

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors