Disclaimer: OK, This is my first README
, so don't expect that mush. Anyways, let's get started.
First things first, i'm using the Minilibix Library developed by 42 Network.
It's what I used to create the Graphical Interface, for the first part, all I did was putting images in the screen.
Note that dynamic, i.e. it should work with any VALID map that ends with the .ber
file extension, e.g.:
map.ber
fd.ber
should be good but it need to follow some rule.
Needs to:
- Be triangle or rectangle.
- Be surrounded by walls.
- Have at least 1 exit.
- Have at least 1 collectible. Have at least 1 Player.
That's basically all ther is for the essentials, if any of these rules are Invalid, it means that there's Misconfiguration in the map.
The map can be composed of only these 5 characters:
- Player
- Exit
- Collectible
- Wall
- Empty Space
It's actually pretty easy, just go to your terminal and type in the following command:
$ make
then :
$ make execute
and the game should be up and running !
W
: Move upS
: Move downD
: Move to the rightA
: Move to the leftEsc
: Exit the Game
You need to collect all the keys (cherries in our case) to open the door and go through it, and you should'nt touch any of the enemies, if you do, you're gonna start over
This is the part where 42 students can pay attention the most.
First thing first u need to now how to use milibix library, it so important for you to know all the functions because they can be very useful. Here's some links that can really help you :
mlx_init()
: It's basically the initialization of the connection between your terminal and the correct graphical system. It return avoid *
which holds the location of our current MLX instance. Tt is the Key Stone for all the other comming minilibix functions, so without it we can't use them.mlx_new_window()
: As it says in its name, It's the function that create the window and it takes 4 arguments, First one is of course thevoid *
returned bymlx_init()
, the 2nd one is the width of the window, the 3rd one is the height of window, and the 4th one of the name aka Title of the window.