How myivanov-c/cub3d works
cub3D is a MiniLibX-based, Star Wars-themed raycasting game. The user supplies a .cub level and launches the game; the documented runtime validates level data, renders a first-person view, and supports movement, camera control, doors, a minimap, and lightsaber animations. The graph preserves these documented capabilities and the libft support layer. Some subsystem links rely on the README because their implementation files were not sampled; uncertain call relationships are omitted.
Main entry points: parser.c Level parser · read_file.c Level file input · rays.c Raycasting · run_weapon_animation.c Weapon animation
Components 25
Game entry and setup
- Game entry
src/main.c - Runtime setup
src/start.c
Level and world
- Level file input
src/read_file.c - Level parser
src/parser.c - Texture and color checks
src/check_elements.c - Map validation
src/check_map.c - Texture loading
src/textures.c
Rendering
- Raycasting
src/rays.c - Grid traversal
src/dda.c - Wall rendering
src/draw.c - Floor and ceiling
src/draw_fc.c - Texture projection
src/handle_floor_ceiling.c - Minimap overlay
src/minimap.c
Gameplay
- Keyboard controls
src/handle_inputs.c - Movement and collision
src/move.c - Mouse look
src/handle_mouse.c - Door interaction
src/doors.c - Door collision checks
src/check_doors.c - Weapon animation
src/run_weapon_animation.c - Weapon HUD
src/draw_weapon_hud.c - Attack HUD
src/draw_attack_hud.c
C support
- libft utilities
inc/libft/libft.h - Line reader
inc/libft/get_next_line.h
Other components
- Player
- MiniLibX
Connections 14
- Player → Game entry: launches
- Game entry → Runtime setup: starts
- Level file input → Level parser: supplies level
- Level parser → Texture and color checks: checks elements
- Level parser → Map validation: validates map
- Raycasting → Grid traversal: traverses grid
- Raycasting → Wall rendering: renders walls
- Floor and ceiling → Texture projection: projects textures
- Keyboard controls → Movement and collision: controls movement
- Door interaction → Door collision checks: handles collision
- Weapon animation → Weapon HUD: shows weapon
- Weapon animation → Attack HUD: shows attacks
- Level file input → Line reader: reads lines
- Runtime setup → MiniLibX: uses graphics