Giter Site home page Giter Site logo

egoncalv / so_long Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6.54 MB

This project is a very small 2D game. Its purpose is to make you work with textures, sprites, and some other very basic gameplay elements.

Makefile 4.01% C 81.57% Roff 12.97% Perl 0.40% Shell 1.05%

so_long's Introduction

so_long

This project is a small 2D game.

Its purpose is to make you work with textures, sprites, and some other basic gameplay elements. I have learned how to manage windows, images, keyboard events, as well as pathfinding algorithms and graphical programming.

The program takes a map, in .ber format, as argument. The map must be formatted as the following:

11111111111111111           1 = Walls
10000C00000000001           0 = Empty Space       
1C0000000000000C1           C = Collectables
11111110111111101           P = Player
100C0000100000001           E = Exit
1C00000E1C000P001
11111111111111111

If the map does not exist, or if it is invalid in any way (Not rectangular, not closed by walls, no player in the map, double exit, etc.) the program must return an Error and exit properly.

Errors screenshot

Another challenge was to check if the map had a valid path (Player being able to reach all collectables and the exit). For that, I wrote a pathfinding algorithm called dfs. If it verifies that there is no valid path, the program exits properly.

Error screenshot

Once everything is checked, the game starts and we are able to play it:

Gameplay gif

To run it (Linux Only), you can use the following command in the root of the repository: make

so_long's People

Contributors

egoncalv 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.