Skip to content

Forstman1/so_long_42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

SO_LONG Project Description

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.

Rules of the map

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:

  1. Player
  2. Exit
  3. Collectible
  4. Wall
  5. Empty Space

alt text alt text alt text alt text

How to Play

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 !

Game Legend:

  • W: Move up
  • S: Move down
  • D: Move to the right
  • A: Move to the left
  • Esc: 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

alt text

How you can create your own so_long

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 :

The Functions you're gonna need & What are they for - 101

  1. mlx_init() : It's basically the initialization of the connection between your terminal and the correct graphical system. It return a void * 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.
  2. 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 the void * returned by mlx_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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published