this was my first graphical project in 42 curriculum.
asset pack used: Sprout Lands by Cup Nooble ʕ•́ᴥ•̀ʔっ
so_long is a small 2d game, created using the MiniLibX graphics library.
we get familiar with mlx and work with textures, sprites, and some other very basic gameplay elements.
the player’s goal is to collect every collectible present on the map, then escape chosing the shortest possible route.
these are some resources i used:
• 2d game programming in c tutorial: snake
• a comprehensive guide to so long
• exploring so_long game: a dive into 2D game development
the minilibx is a C library used for rendering graphics, primarily used by 42 students.
this library is built on top of the X Window System API, to provide a simple programming interface suited for beginners.
here are some resources in case you wanna get familiar with it:
• getting started with the minilibx;
• pixel drawing with the minilibx;
-
clone this repository:
git clone [email protected]:idleira/so_long.git so_long
-
all of the following commands should be run in the root of the directory:
cd so_long
; -
this project is divided in 2, mandatory and bonus, parts.
• to run mandatory (basic character movement and item collecting) part, use
make
;• to run bonus (on-screen move counter and enemy patrol) part, use
make bonus
. -
run the game with a map of your choosing from /maps:
./so_long maps/map1.ber
i provided some valid and invalid maps in the maps folder, however you're welcome to create your own.
the program will run any map as long as it passes all the requirements:
-
map file has to end with the .ber extension;
-
the only valid characters are:
◦
P
(player);◦
1
(wall);◦
0
(empty cell);◦
C
(collectible);◦
E
(exit);◦
V
(enemy in bonus). -
there must be ONE exit, ONE player, and at least one collectible on the map;
-
map must be rectangular, i.e. all rows must have the same length;
-
map must be closed, i.e. surrounded by walls.