Skip to content

Cub3D is a basic 3D game engine using raycasting, built in C with MiniLibX. Inspired by Wolfenstein 3D, it renders a first-person view from a 2D map, handling textures, player movement, and wall collisions.

Notifications You must be signed in to change notification settings

ayeshamk23/Cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕹️ Cub3D

A first-person 3D renderer using raycasting — inspired by Wolfenstein 3D and powered by C and MiniLibX.

📌 Description

Cub3D is a 42 School project that challenges students to build a simple 3D engine using raycasting. The player explores a world rendered from a 2D map, with textured walls, real-time movement, and collision detection — all without using any external game engine.

But for me, this project became something more personal.

🎨 Personal Touch

I truly enjoyed working on Cub3D because I used it as an opportunity to turn the in-game walls into an art gallery — featuring my own original artworks as textures! Framing my art within the digital space I built from scratch was both surreal and incredibly fulfilling. It felt like coding a canvas, and every hallway became a piece of interactive storytelling.

🎮 Features

  • Raycasting-based 3D rendering from a 2D map
  • Real-time movement, rotation, and collision detection
  • Wall textures and sky/floor coloring
  • Minimap overlay (optional)
  • Custom map parsing from .cub files
  • Keyboard controls for movement and escape

🕹️ Controls

  • W / – Move forward
  • S / – Move backward
  • A – Strafe left
  • D – Strafe right
  • / – Rotate view
  • ESC – Exit game

🚀 Run the Project

make
./cub3D maps/ayeshamk.cub

📘 Concepts Learned

  • Raycasting and line-of-sight rendering
  • Grid-based movement and collision handling
  • Texture mapping and perspective projection
  • Parsing and validating custom map formats
  • Low-level graphics programming with MiniLibX
  • Clean code architecture and real-time input handling

my project

screen-recording-2025-05-15-at-65546-pm-pj8tqwls-1_DlpeijrH.1.mp4

About

Cub3D is a basic 3D game engine using raycasting, built in C with MiniLibX. Inspired by Wolfenstein 3D, it renders a first-person view from a 2D map, handling textures, player movement, and wall collisions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published