BenoitRoux0 / cub3D

Home Page:https://projects.intra.42.fr/cub3d/mine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

42_CUB3D

๐Ÿ“‘ Introduction

CUB3D is a project that involves creating a basic raycasting game engine inspired by the classic game Wolfenstein 3D.
It's a visual exploration of raycasting techniques to render a 3D-like environment.

๐ŸŽฎ๏ธ Description

The CUB3D project challenges you to build a simple game engine that can render a textured maze-like environment in a 2D window.
The core of the project revolves around raycasting, a technique that simulates a 3D perspective by casting rays from the player's viewpoint
and calculating the intersections with walls and other objects. The project requirement asked us to parse a map file that defines the layout of the maze, handle player movement,
and render the scene using textures.
Other features, such as wall collision, mouse mouvement, controller handling and such were optional.

๐Ÿ› ๏ธ Implementation

Creating the CUB3D game engine asked us to work on the following components:

  • Map parsing: Read and interpret the map file that defines the maze layout, textures, and other properties.
  • Raycasting: Cast rays to calculate distances to walls and objects in the player's view, creating the 3D-like effect.
  • Texturing: Apply textures to walls and other surfaces based on the raycasting results.
  • Player movement: Implement controls for player movement, rotation.
  • Graphic rendering: Set up a window and render the scene using the MinilibX graphical library
  • Game controller handling: Handle game controller inputs by reading the controller input file on a separate thread.

๐Ÿ’ฝ Usage

To compile the program, run the following command:

make

It will compile the program and create an executable called "cub3D".

To run the program, simply execute the created executable:

./cub3D path_to_map.cub

This will only give you access to the mandatory part of the project.
To compile the bonus part, run the following command:

make bonus

Then, launch the bonus executable with the following command:

./cub3D_bonus path_to_map.cub

๐ŸŽฎ Controller handling

In the bonus part, we implemented a game controller handling feature.
Press "M" on the keyboard to swap beetwen four controller modes:

  • Keyboard only
  • Keyboard + Mouse
  • Controller only (tested with an xbox 360 controller, but should work with any controller)
  • Guitar Hero controller (tested with a Guitar Hero 3 controller, but should work with any guitar hero controller)

โš ๏ธ Warning

This project is a part of the 42-Cursus curriculum and is intended for educational purposes.
If you are currently a student in any 42-affiliated campus, we strongly advise you not to copy this project or submit it as your own work, as it goes against the school's academic integrity policy.
We will not be responsible for any misuse of the project or academic penalties that may arise from it. However, you are welcome to use this project as a reference or for learning purposes.

๐Ÿ•’ Project Duration

The mandatory part was made in roughly one month.
Every other Bonus features were added in the span of another month.

๐Ÿ™‡ Author

Guillaume d'harcourt

Benoit Roux

About

https://projects.intra.42.fr/cub3d/mine


Languages

Language:C 91.0%Language:Roff 5.7%Language:Makefile 2.8%Language:Shell 0.5%Language:Perl 0.2%