The objective of this project is to create a small 2D game where the player has to collect all the collectibles and go to the exit.
- The game we choose must follow a set of rules. The executable so_long will receive a map as the only argument, and this map will have a .ber filetype.
- Only P (character), 1 (wall), 0 (ground), C (collectible), and E (exit) will be accepted characters in our map.
- The map must be rectangular, i.e. all rows must have the same length
- There must be at least one exit, one player, and one collectible on the map
- The map must be closed, i.e. surrounded by walls
- If any of these checks fail, the game must end with Error\n followed by a custom message.
- The goal is for the player(s) to collect all the collectibles on the map before going to an exit in the least possible number of steps
Clone this repository:
git clone https://github.com/whymami/so_long.git
To compile the project, run the following command
make
Run the following command to compile the bonus part
make bonus
To start the game, ./so_long maps/map2.ber
./so_long_bonus maps/map_bonus/map2.ber
Character | Description |
---|---|
0 |
Ground |
1 |
Wall |
P |
Player |
E |
Exit |
C |
Collectable |
X |
Villain |
Keyboard | Action |
---|---|
W | Moving Up |
S | Moving Down |
A | Moving left |
D | Moving right |
ESC, ⎋ |
Close the game |