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.
- Raycasting-based wall rendering with per-side textures
- Smooth player movement: walk, strafe, rotate
- Wall collision detection
.cubmap parser with texture, color, and player-spawn directives- Built on MiniLibX
makeProduces the cub3D executable.
./cub3D maps/example.cub| Key | Action |
|---|---|
W / S |
Move forward / backward |
A / D |
Strafe left / right |
← / → |
Rotate view |
ESC |
Quit |
A .cub file declares textures, floor/ceiling colors, and a tile grid. Tiles:
1— wall0— empty spaceN/S/E/W— player start position + facing direction
Example:
111111
100001
1000N1
100001
111111
main.c,cub3d.h— entry + headersparsing/—.cubfile parser and map validatorraycasting/— DDA raycaster + texture samplingkey_handles/— keyboard inputgame_textures/— wall texturesincludes/,libft/,mlx/— shared headers, libft, MiniLibXmaps/— sample maps