Skip to content

This project is a small 2D game with minilibx. You'll learn about textures, sprites and tiles.

Notifications You must be signed in to change notification settings

AtibQur/so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Score

Description So_long 🎮 🕹️

This project is all about creating a top down 2d game using the MLX library. The game reads a map which include a player(P), exit(E), collectables(C), walls(1), background(0) and an optional enemy(A). The goal is to create a game where collectables are collected before you can exit the game. In order to do this, your player character has to move over the collectable and collect the items.

Rules

  • The W, A, S, and D keys must be used to move the main character.
  • The player should be able to move in these 4 directions: up, down, left, right.
  • The player should not be able to move into walls.
  • At every move, the current number of movements must be displayed in the shell.
  • Your program has to display the image in a window
  • The management of your window must remain smooth (changing to another window, minimizing, and so forth).
  • Pressing ESC must close the window and quit the program in a clean way.
  • Clicking on the cross on the window’s frame must close the window and quit the program in a clean way.
  • The map must be rectangular.

  • Installation ⚙️

    *To build the programm there is only a few steps: First of all, you can download the repository through the following steps in any shell of your preference:*
    git clone git@github.com:AtibQur/so_long.git
    cd so_long
    make
    
    These commands will compile everything and a executable "so_long" should be created.

    Usage 🛠️

    To compile the program, run the following command:

    cd so_long && make
    ./so_long maps_valid_map.ber
    
    After creating the executable, the function is ready for use. This function only takes a map with an .ber extension.

    Function explanation 📚

  • initialize/start the game and give values to map variables.
  • parse/read through the map and do error managment for rectacle map, map variables, .ber extension. Give every position of the map it's own value(content).
  • read through the map and check if there's the required content items to start the game. give every content items it's own starting position.
  • give every node it's own image.
  • create the window and initialize the adress for every node img.
  • push every image to the window.
  • loop through every picture for the animation effect
  • create events for every key that is pressed
  • loops through the program and won't stop until ESC is pressed or force quit.
  • Third-party helpers/testers

    https://harm-smits.github.io/42docs/
    https://eastmanreference.com/complete-list-of-applescript-key-codes

    About

    This project is a small 2D game with minilibx. You'll learn about textures, sprites and tiles.

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published