How rvnsenkuuu/so_long works
This repository implements so_long, a small tile-based game launched with a map-file argument. Its central workflow is to validate the arguments and map, initialize the game window, render the board, and update the player’s position as input arrives; collecting all items enables the exit, while bonus movement also handles bombs. The tree shows parallel normal and bonus implementations. Main-flow calls are visible in the sampled entry point, but most subsystem wiring is inferred only from filenames, so uncertain links are omitted.
Main entry points: main.c Game entry · init_imgs.c Bonus sprites · player_move.c Player movement · main_bonus.c Bonus entry
Components 21
Startup and map
- Game entry
srcs/main.c - Argument checks
srcs/check_argv.c - Map initialization
srcs/init_map.c - Map reading
srcs/read_map.c - Map validation
srcs/check_map.c - Map checks
srcs/check_map_utils.c - Path validation
srcs/flood_fill.c
Gameplay
- Game map
include/so_long.h - Player movement
srcs/player_move.c - Win and quit
srcs/game_condition.c - Error handling
srcs/error.c
Display
- Window setup
srcs/handle_mlx.c - Game rendering
srcs/render_game.c - MiniLibX
lib/mlx-linux/mlx.h
Bonus mode
- Bonus entry
srcs_bonus/main_bonus.c - Bonus movement
srcs_bonus/player_move_bonus.c - Bonus outcomes
srcs_bonus/game_condition_bonus.c - Bonus rendering
srcs_bonus/render_game_bonus.c - Bonus sprites
srcs_bonus/init_imgs.c - Bonus map checks
srcs_bonus/check_map_bonus.c
Other components
- Player
Connections 8
- Player → Game entry: starts
- Game entry → Argument checks: checks arguments
- Game entry → Map initialization: initializes map
- Game entry → Window setup: initializes display
- Player movement → Win and quit: sets outcome
- Bonus movement → Bonus outcomes: sets outcome
- Bonus entry → Bonus sprites: initializes sprites
- Bonus rendering → Bonus sprites: uses sprites