So_Long
is a simple 2D game where the player must collect items and find the exit on a predefined map. The game is inspired by the universe of Freeze Corleone. It utilizes textures, sprites, and basic gameplay mechanics. The primary goal of this project is to help you work with basic computer graphics, window management, and event handling using the MiniLibX library.
-
Game Objective:
- The player must collect all collectibles on the map and reach the exit.
- The game is controlled with the keyboard using either the
W
,A
,S
, andD
keys or the arrow keys for movement. - Movement should be restricted to valid spaces, avoiding walls.
- The number of moves is displayed in the terminal after each action.
-
Map:
- The map is built from specific characters:
0
for empty space,1
for walls,C
for collectibles,E
for exits, andP
for the player's start position. - Maps must be rectangular, surrounded by walls, and contain at least one exit, one collectible, and one starting point.
- The map is built from specific characters:
To use the so_long
program:
-
Compile the Project:
make
-
Run the Program:
./so_long <map_file.ber>
Replace
<map_file.ber>
with the path to a valid.ber
map file. -
Example:
./so_long maps/simple_map.ber
This will start the game using the specified map file.
Here is an example of a valid .ber
map file:
1111111
1P00001
100C0E1
1111111
P - Player's starting position.
C - Collectible.
E - Exit.
1 - Wall.
0 - Empty space.
This project is compatible with both macOS and Linux systems, but there is a graphical issue where sprites are not rendering as transparent on Linux.
I used PiskelApp to modify the player sprite to show the back view and to make the exit appear closed. Here are the links to the assets used in the project :
