Hive Helsinki (School 42) 6th curriculum project (Rank02)
About · Program · Requirements · Instructions · References
The repository contains a program for lauchning a 2D top down game using functions from the MLX42 graphics library running on GLFW and OpenGL.
The player is able to move in 4 directions and can pick up collectibles. Once all collectibles are picked up, the game can be exited via a special exit field. Collision detection is used in order to avoid that the player can go through walls. A check using a flood fill algorithm ensures that the player/map is surrounded by walls and that no collectible or the exit are fenced. The executable takes a .ber file as argument which contains the map of the game. The requirements for a valid map are:
- only one player ('P') present
- map must be closed by walls ('1')
- map must have open spaces ('0')
- at leat 1 collectible ('C)
- an exit ('E')
gcc
compilerGLFW
library
To compile the program, navigate into the repo folder and run:
$ make
Start the game by passing a valid .ber map file (see respective map folder) to the executable e.g.:
$ ./so_long valid.ber
W, A, S, D
or
⬅︎⬆︎⬇︎➡︎
All collectibles need to be picked up before the exit field is functional.
The game can be closed by hitting ESC
or clicking on the x
of the window.
The MLX42 library was downloaded from the following repo: (https://github.com/codam-coding-college/MLX42)
The player image was taken from: (https://akoro.itch.io/pixel-mons-52-monsters-size-24x24)
Images for collectibles, floor and walls were taken from: (https://game-endeavor.itch.io/mystic-woods)