Giter Club home page Giter Club logo

so_long's Introduction

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—         โ–ˆโ–ˆโ•—      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— 
โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—        โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘        โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ–ˆโ•—
โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘        โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•
โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• 

game img

So Long ๐Ÿ•น๏ธ

This project is part of the 42 School curriculum. It is the fifth project, although it is the first graphic project in the Cursus. The project aims to create a 2D video game using the graphic library MiniLibX from the campus and the C language.

Project Description ๐Ÿ“–

In this project, I use the MiniLibX graphic library to create a window, manipulate images, and work with keyboard events. This library is a reduced and adapted version of OpenGL.

It involves a series of validations for the map passed as an argument, checks to prevent memory leaks, game engineering, managing windows, events, sprites, and maps.

In my case, I set the challenge of making it run on MACos, Linux, and Windows11, although at the moment, Windows is unsupported. For this challenge, I had to create the game on MACos and later adapt it to Linux, since MiniLibX was originally built for MACos, and when adapting it to Linux, most functions and hooks had their names changed or even their forms.

Requisites โš ๏ธ

If you want to download my repo and try it out, you must consider your operating system.

  • ๐ŸŽ Macos -> In this operating system it is not necessary to download anything previously, since we access the OpenGL API.
  • ๐Ÿง Linux -> currently no version available, sorry ๐Ÿฅฒ
  • ๐ŸชŸ windows -> it was to much, seriusly ๐Ÿ’€

Usage ๐ŸคŸ

Once compiled, run the program, and you can interact with the window using the keyboard.

  1. Clone this repository to your local machine.
git clone https://github.com/alexhiguera/So_long.git
  1. Run the compilation command to generate the executable and run game:
make play

Sprites ๐ŸŽž๏ธ

The images of the sprites must be in .xpm format. If you want to create your sprites, follow these steps:

  1. Find or create sprites in any image format.
  2. Resize them in any editing program to 64px x 64px. (64px is not arbitrary; my project is defined like that, check what you need in your case).
  3. Transform to the .xpm format through Convertio.

Controls ๐ŸŽฎ

KEY OBJECT
W or โฌ†๏ธ Move up
A or โฌ…๏ธ Move left
S or โฌ‡๏ธ Move down
D or โžก๏ธ Move right
Q or Esc Close the game

Map ๐Ÿ—บ๏ธ

You can create another map if you wish, as it can analyze any type of map, as long as it follows these rules:

  • The map must be a .ber file.
  • It can only contain these characters:
  • It must be rectangular and surrounded by walls.
  • The map must contain at least one exit, one collectible, and an initial position.
OBJECT CHAR
Wall 1
Coin C
Exit E
Player P
Floor 0

See some examples in the /assets/maps folder ๐Ÿ—บ๏ธ.

ejemplo:

11111111111
10C0P1C0011
10000100001
1C0000C0001
111C01E00C1
11111111111

game img

so_long's People

Contributors

alexenurduliz42 avatar alexhiguera avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

alexenurduliz42

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.