A simple 2D game developed in C using the MiniLibX graphical library.
The goal is to navigate a map, collect all items and reach the exit while avoiding enemies.
git clone
cd so_long
make all
./so_long maps/map_correct.ber
W: Move up
A: Move left
S: Move down
D: Move right
ESC / SPACE: Quit the game
- Map parsing and validation
- 2D tile-based rendering using MiniLibx
- Collectibles and exit logic
- Basic enemy logic (random movement)
- User keyboard-input handling
- Animated sprite
- Error handling with descriptive messages
- Flood Fill is used to do map validation (closed map, accessible collectibles and exit, correct number of game elements)
- Animated sprite uses a linked list of images and a frame-based update system. Every few frames, the animation advances to the next image of the linked list. When the sprite hits an obstacle, the animation loop resets along with the movement direction.
- Rendering and input handling rely on MiniLibX event hooks (
mlx_hook,mlx_loop_hook,mlx_loop)
