Skip to content

42OK42/Cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cub3D

Overview

Cub3D is a captivating 3D maze exploration game created as part of the 42 school curriculum. This project tasked us with recreating the iconic first-person view of Wolfenstein 3D using raycasting techniques, challenging our skills in graphical programming and algorithmic problem-solving.

At its heart, Cub3D converts a 2D map into a 3D interactive environment, providing players with a realistic sense of depth and perspective. Navigate through corridors, rooms, and open areas, all dynamically rendered in real-time through sophisticated mathematical computations and efficient coding.

We have exceeded the basic requirements by incorporating a dynamic minimap for better navigation, elevating the gameplay experience significantly. This project not only hones programming skills but also requires a deep understanding of graphics rendering, spatial awareness, and optimization strategies. It merges mathematics, physics, and computer science into a compelling gaming experience.

Key Features

  • Realistic 3D perspective rendering leveraging advanced raycasting techniques
  • Textured walls with distinct textures for each cardinal direction
  • Smooth player movement and intuitive camera rotation
  • Accurate collision detection to ensure game integrity
  • Dynamic Minimap: Provides a real-time 2D view of the maze for improved navigation
  • Extensive customization options in the settings file, including colors, screen size, and raycaster parameters
  • Ability to upload custom images for wall textures and create custom maps, with automatic validation checks

Technologies Used

  • C programming language for robust and efficient code
  • MinilibX graphics library for rendering and window management
  • Raycasting algorithms for 3D perspective rendering
  • File parsing techniques for map creation and validation

Installation Guide

Prerequisites

  • gcc compiler
  • Make

Installation

Clone the repository:

git clone git@github.com:42OK42/Cubed3D.git

Navigate to the project directory:

cd cub3d

Compile the project:

make

Usage

Run the executable with any map file from the resources folder, for example:

./cub3D resources/valid_map_1.cub

Controls

  • W/A/S/D: Move the player through the maze
  • Left/Right arrow keys: Rotate the camera view
  • ESC: Exit the game

Customization

The settings file allows you to customize various aspects of the game, including:

  • Minimap settings
  • Colors
  • Screen size
  • Number of rays for the raycaster

You can also upload your own images for wall textures and create custom maps. The system automatically checks these maps for validity.

Map File Format

  • .cub extension
  • Texture paths for North, South, East, and West walls
  • Floor and ceiling colors (RGB format)
  • Map layout using characters:
    • 0: Empty space
    • 1: Wall
    • N/S/E/W: Player starting position and orientation

Acknowledgements

  • 42 School for providing the challenging project requirements and resources
  • The creators of Wolfenstein 3D for the original inspiration
  • Raycasting tutorial by 3DSage for invaluable insights
  • Special thanks to my teammate Damian, whose dedication, ideas, and collaborative spirit were crucial in bringing this project to life.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages