Skip to content

wolfofclaude/cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cub3D

A 42 project: a basic 3D game engine built with raycasting, inspired by Wolfenstein 3D. The renderer projects a 3D view from a 2D map and supports textured walls, player movement, and collision.

If you're learning raycasting for this project, read the Pikuma raycasting course first — understand it instead of copy-pasting Lodev code.

Features

  • Raycasting-based wall rendering with per-side textures
  • Smooth player movement: walk, strafe, rotate
  • Wall collision detection
  • .cub map parser with texture, color, and player-spawn directives
  • Built on MiniLibX

Build

make

Produces the cub3D executable.

Run

./cub3D maps/example.cub

Controls

Key Action
W / S Move forward / backward
A / D Strafe left / right
/ Rotate view
ESC Quit

Map format

A .cub file declares textures, floor/ceiling colors, and a tile grid. Tiles:

  • 1 — wall
  • 0 — empty space
  • N / S / E / W — player start position + facing direction

Example:

111111
100001
1000N1
100001
111111

Layout

  • main.c, cub3d.h — entry + headers
  • parsing/.cub file parser and map validator
  • raycasting/ — DDA raycaster + texture sampling
  • key_handles/ — keyboard input
  • game_textures/ — wall textures
  • includes/, libft/, mlx/ — shared headers, libft, MiniLibX
  • maps/ — sample maps

Resources

About

42 Project done in C using minilibX and Raycasting to create a replica of Wolfenstein.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors