A small 2D tile-based game built in C using the MiniLibX graphics library.
so_long is a simple 2D game where the player must collect all collectibles on the map and reach the exit. The map is loaded from a .ber file and rendered tile by tile using MiniLibX. The project introduces graphical programming concepts in C without using any game engine.
- Move the player with
W,A,S,Dor arrow keys - Collect all items (
C) before reaching the exit (E) - The map is validated at startup (valid path, surrounded by walls, at least one player, one exit, one collectible)
- Move count is displayed in the terminal
1111111111
1000000001
1C0001E001
1000P00001
1111111111
| Symbol | Meaning |
|---|---|
1 |
Wall |
0 |
Empty space |
P |
Player start |
C |
Collectible |
E |
Exit |
- Language: C
- Library: MiniLibX (X11 / macOS)
- Key concepts: event loop, sprite rendering, 2D map parsing, flood-fill validation
main → parse .ber file → validate map (flood-fill)
→ init MiniLibX window
→ render all tiles from map array
→ hook keyboard events → update player position → re-render
| Field | Value |
|---|---|
| Project | so_long |
| Circle | 2 |
| Norminette | Compliant |
- Graphical programming with MiniLibX (window, image, events)
- 2D map parsing and validation with flood-fill
- Game loop design: event handling → state update → render