The so_long project is a simple 2D game developed in C using the MiniLibX graphics library. The goal of the game is to guide a character through a maze, collecting items along the way and avoiding obstacles. The player must complete the game with the fewest number of moves possible.
Before compiling and running the project, make sure you have the MiniLibX installed in project folder. For that, after cloning, it's necessary to extract the contents of the minilibx-Linux.tgz
file, rename the folder with the name mlx
, and copy and paste this in the folder lib
.
To compile the project, run:
make
This will compile the source files and generate the so_long
executable.
After compilation, you can run the game using the following command:
./so_long <map>
Replace <map>
with the path to the map file you want to use. The map file should have the .ber
extension and follow the format specified in the project. Inside the assets/maps
folder there are some examples of valid and invalid maps.
- The player starts at an initial position marked by a character.
- The goal is to collect all the items represented by collectibles (
C
) on the map. - The player must avoid obstacles represented by walls (
1
) and enemies (E
). - The player can move in the up, down, left, and right directions using the arrow keys.
- The game ends when the player collects all the items and returns to the initial position or is captured by an enemy.
- The number of moves made by the player is displayed in the game window.
W
,S
,D
,A
andArrow keys
: move the character in the up, down, left, and right directions.ESC
key: exit the game.
The sprites used in the game were created by me using the GIMP application. Here a small tutorial on how to create sprites using GIMP: https://thegimptutorials.com/how-to-make-pixel-art/. If you want to use the sprites that I created, or modify them, you can use the sprites.xcf file.
so_long_invalidator: https://github.com/Nuno-Jesus/so_long_invalidator