So_long is a small 2D game where the player must collect all collectibles and escape through the exit. The game is built using the MiniLibX graphical library, with a focus on window management, textures, and event handling.
- 2D grid-based movement
- Basic sprite and texture handling
- Map validation and error handling
- Player movement via keyboard (W, A, S, D or arrow keys)
- Clone the repository:
git clone https://github.com/LAHMAMI1/So_long.git
- Navigate to the project directory:
cd So_long
- Compile the game:
make
- Run the game with a
.ber
map file:./so_long maps/map.ber
- Objective: Collect all items (C), then find the exit (E).
- Movement: Use
W
,A
,S
, andD
or arrow keys to move up, left, down, and right respectively. - Exit: After collecting all collectibles, move to the exit to win the game.
- The map consists of:
0
: Empty space1
: WallC
: CollectibleE
: ExitP
: Player starting position
- The player cannot move through walls and must collect all collectibles before reaching the exit.
- The game displays the number of moves in the terminal.
- The map must be rectangular and surrounded by walls (
1
). - It should contain at least one exit (
E
), one collectible (C
), and one starting position (P
). - If the map is invalid, the game will display an error and exit.
1111111111111
10010000000C1
1000011111001
1P0011E000001
10001C0000011
1000110000C01
111C000001111
1111111111111
- Enemy patrols that cause the player to lose when touched.
- On-screen movement counter instead of terminal display.
- Simple sprite animations.