So Long is a fun and engaging project where you create a small 2D game using MiniLibX, the school's graphical library. The game revolves around navigating a character through a map to collect items and find an exit. This project was an exciting opportunity to dive into 2D graphics, window management, event handling, and more, all while honing C programming skills.
In this game, the player navigates a map filled with walls, collectibles, and an exit. Using keyboard inputs, the player moves the character to collect all items and reach the exit through the shortest possible route. The game displays movements in the terminal and provides clean and responsive graphic management.
-
Basic Gameplay:
- Move the player character using
W
,A
,S
,D
(orZ
,Q
,S
,D
). - Collect all items (
C
) and reach the exit (E
) to win. - Movement is restricted by walls (
1
). - Movement count is displayed in the terminal.
- Move the player character using
-
Graphical Features:
- 2D top-down or profile view.
- Smooth window management: resizing, minimizing, and closing.
- Window can be closed using
ESC
or the close button.
-
Map Handling:
- The map is loaded from a
.ber
file. - Valid maps include:
- Walls (
1
), empty spaces (0
), collectibles (C
), exit (E
), and player start (P
). - Exactly 1 player start and 1 exit.
- Surrounded by walls, rectangular, and contain at least one collectible.
- A valid path from the player to the exit, covering all collectibles.
- Walls (
- The map is loaded from a
- Mandatory Files:
- Source files:
*.c
- Header files:
*.h
- Assets:
textures
(e.g., sprites for the game) - Maps:
.ber
files (map descriptions) - Makefile: Includes rules for
NAME
,all
,clean
,fclean
,re
.
- Source files:
1111111111111
10010000000C1
1000011111001
1P0011E000001
1111111111111