Skip to content

sarahayman22/Cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕹️ Cub3D

Cub3D is a 3D graphical project developed as part of the curriculum at 42 School.
It recreates a classic raycasting engine like that in Wolfenstein 3D, transforming a simple 2D map into a real-time 3D first-person experience — built entirely in C using the MiniLibX graphics library.

🛠️ Built with: C, MiniLibX (X11), Linux
🎮 Goal: Create a 3D-like game experience from scratch with low-level tools
💡 Key Concepts: Raycasting, real-time rendering, vector math, player control, texture mapping


🚀 Features

  • 🔭 Raycasting Engine

    • DDA (Digital Differential Analyzer) algorithm to detect wall collisions
    • Perspective projection for depth simulation
  • 🧱 Wall Rendering

    • Texture support for all directions (North, South, East, West)
    • Accurate texture mapping
  • 📜 Map Parsing & Validation

    • Parses .cub files with textures, floor/ceiling colors, and layout
    • Validates player position, map closure, and identifier correctness
  • 👤 Player Movement

    • W, A, S, D for movement
    • Arrow keys for smooth rotation
    • Collision detection
  • 🎨 Floor & Ceiling Colors

    • Customizable RGB values from .cub file
  • 🗺️ Minimap (Bonus)

    • Displays player position and field of view
    • Updates in real time
  • 🚪 Doors & Animations (Bonus)

    • Interactive elements like doors or animated textures

🧾 File Format Example (.cub)

NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm
F 220,100,0
C 225,30,0

1111111111
1000000001
1000110001
1000N00001
1111111111

NO/SO/WE/EA: Texture paths for walls
F/C: RGB colors for Floor and Ceiling
1: Wall, 0: Empty space
N: Player starting position and direction

👥 Team

This project was developed as part of the 42 School curriculum by:
🧑‍💻 @ramasham
🧑‍💻 @sarahayman22

About

A raycasting-based 3D maze game inspired by the classic 90's FPS, built using C and the MLX graphics library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors