Skip to content

SirAlabar/cub3D

Repository files navigation

๐ŸŽฎ cub3D - 3D Maze Game

cub3D Banner

๐Ÿ“– Overview

cub3D is a 3D maze game built using raycasting technology, inspired by the legendary Wolfenstein 3D game. This project is part of the 42 School curriculum, demonstrating advanced graphics programming concepts and game development fundamentals.

Gameplay Demo

โœจ Features

Core Features

  • ๐ŸŽฅ First-person 3D visualization using raycasting
  • ๐Ÿƒโ€โ™‚๏ธ Smooth player movement (W, A, S, D keys)
  • ๐Ÿ”„ View rotation (arrow keys)
  • ๐ŸŽจ Textured walls with different textures for each direction (N, S, E, W)
  • ๐ŸŽช Customizable floor and ceiling colors
  • ๐Ÿ—บ๏ธ Custom map format support (.cub files)
  • ๐Ÿ–ฅ๏ธ Clean window management
Features Demo

Bonus Features

  • ๐Ÿ’ฅ Wall collision detection
  • ๐Ÿ—บ๏ธ Dynamic minimap system
  • ๐Ÿšช Interactive doors
  • ๐ŸŽฌ Animated sprites
  • ๐Ÿ–ฑ๏ธ Mouse-controlled camera rotation
Bonus Features Demo

๐ŸŽฏ Installation

# Clone this repository
git clone https://github.com/yourusername/cub3d.git

# Navigate to the project directory
cd cub3d

# Compile the project
make

# Run with a map
./cub3D maps/example.cub

๐ŸŽฎ Controls

Key Action
W Move forward
S Move backward
A Strafe left
D Strafe right
โ† Rotate camera left
โ†’ Rotate camera right
ESC Exit game
Mouse Camera rotation (bonus)
E Interact with doors (bonus)

๐Ÿ—บ๏ธ Map Format

Maps use the .cub extension and follow this format:

NO ./path_to_north_texture
SO ./path_to_south_texture
WE ./path_to_west_texture
EA ./path_to_east_texture
F 220,100,0
C 225,30,0

111111111111
100000000001
100000000001
100000N00001
111111111111

Map Elements

  • 0: Empty space
  • 1: Wall
  • N/S/E/W: Player start position and orientation
  • D: Door (bonus feature)
Map Examples

๐Ÿ› ๏ธ Technical Details

Technologies Used

  • C programming language
  • MinilibX graphics library
  • Math library
  • Raycasting technique

Architecture

cub3D/
โ”œโ”€โ”€ src/          # Source files
โ”œโ”€โ”€ includes/     # Header files
โ”œโ”€โ”€ assets/       # Textures and maps
โ”œโ”€โ”€ libft/        # Custom library
โ””โ”€โ”€ maps/         # Game maps

๐Ÿ“Š Performance

Performance Metrics
  • Average FPS: XX
  • Memory Usage: XX MB
  • Load Time: XX ms

๐ŸŽฅ Showcase

Basic Navigation

Navigation Demo

Texture Mapping

Texture Mapping Demo

Bonus Features

Bonus Features Demo

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE.md file for details.

๐Ÿ‘ Acknowledgments

๐Ÿ“ฌ Contact

Hugo Marta - @SirAlabar

Markos Santos - @MarkosComK

Project Link: https://github.com/SirAlabar/cub3D


Made with โค๏ธ by @hluiz-ma and @marsoare