Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3d

This project has been created as part of the 42 curriculum by maiguna and marfranc.

cub3D

Description

cub3D is a 3D maze exploration project inspired by the game Wolfenstein 3D, one of the first First-Person Shooter games ever made. Our project is build entirely in C using the MiniLibX graphics library, it implements a raycasting engine from scratch to simulate a 3D perspective inside a 2D map.

The goal is to render a navigable 3D environment parsed from a .cub scene file, handling textures for each wall direction (North, South, East, West) and a configurable floor/ceiling color. The player can move and rotate through the maze in real time.

Features

Mandatory

  • Raycasting engine rendering walls with different textures per direction (N/S/E/W)
  • Smooth player movement and camera rotation
  • Scene configuration via .cub file (map, textures, colors)
  • Map validation (closed walls, valid characters, etc.)
  • Floor and ceiling color rendering

Bonus

  • Wall collisions — the player cannot walk through walls
  • Minimap system — a top-down minimap overlay showing the player's position

Instructions

  • Linux
  • gcc compiler
  • make
  • MiniLibX (included or installable via the system)

Compilation

clone the report of our cub3D (from Github ou git's link Intra V2/V3)
cd cub3D
git clone https:\/\/github.com/42paris/minilibx-linux.git
make or make valgrind to use is with valgrind

Execution

./cub3D maps/map.cub
Key Action
W / Move forward
S / Move backward
A Strafe left
D Strafe right
Rotate camera left
Rotate camera right
ESC / x Quit the game

Scene File Format (.cub)

NO ./textures/north.xpm
SO ./textures/south.xpm
WE ./textures/west.xpm
EA ./textures/east.xpm

F 220,100,0
C 30,30,200

        1111111
        1000001
        1011101
111111111010001
100000000010001
111111111110001
        100   1
        111111
  • NO/SO/WE/EA — paths to XPM wall textures
  • F / C — Floor / Ceiling RGB colors
  • Map must be surrounded by walls (1), spaces allowed outside

Resources

Documentation, articles and tutorials

MiniLibX

AI Usage

AI (Claude by Anthropic) was used during this project for the following tasks:

  • Debugging — helping identify logic errors in the raycasting loop and texture mapping
  • Math explanations — clarifying DDA algorithm steps and vector math for player direction and camera plane
  • README writing — generating and structuring this documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages