Skip to content

SirAlabar/cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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