Giter Club home page Giter Club logo

so_long's Introduction

so_long 102/100 (October 2021)

This is my solution for the so_long project of the core curriculum of 42 school.

Explanation of the project

This projects goal is to create your own 2D game where you have a map that can have different dimensions and contents.

Requirements to run the game

Only tested on macOS Catalina (Version 10.15.7).
For all other OS it is not guaranteed to work.
OpenGL and AppKit is required to run it.
If you want to run it on Linux here is a tutorial that might help and here is the required version of miniLibX, this is not tested with my so_long.

Map

A valid map is structured as followed:

  • 1 player (P)
  • at least 1 exit (E)
  • at least 1 collectible (C)`
  • is recatangular
  • has a solid outside border out of walls (1)
  • all the empty spaces are filled with 0
  • map has to be .ber
  • no other characters than:
    • P
    • E
    • C
    • 1
    • 0
  • i.e. map1.ber:
  • one new line after the map is valid, if there is anything else, it is not valid
1111111111111
10010000000C1
1000011111001
1P0011E000011
1111111111111

During the game

The player can only be moved by WASD.
The player can not move into walls.
The player can only exit if all collectibles are collected.
The amount of movements is counted and displayed in the terminal.
Every try to move even if it is invalid will be counted as one move.

All the visualization is done with the help of the MiniLibX library.

How to run the game

All of the commands should be run in the root of the directory.

  • compile with make all
  • run the game with ./so_long maps/map1.ber

This is how the game looks for the map1.ber.

This is what will be written in the terminal during the game when you successfully win the game.

This is what will be written in the terminal if you give up by closing the game by pressing ESC or clicking the red cross.

so_long's People

Contributors

bderya avatar tblaase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.