Giter Site home page Giter Site logo

snake's Introduction

Snake

Simple Snake game built with C, C++, CMAKE, for Linux based systems.

GUI

The graphical interface is based on XLib, through the following wrapper, written in C: gfx v2 (University of Notre Dame) with some modifications made by me. The modified gfx files are included in the source files. Needless to say, I have no rights over them. Nevertheless, if the functions I added ('gfx_text', 'gfx_close') are found useful for some purpose, feel free to use them however you want.

Compiling

gfx v2 was compiled (into gfx/libgfx.a) using GCC 10.2.1 with the following flags:

-fPIC -c -lX11 -lm -pthread -DNDEBUG

For the compilation of the game itself, those flags were used:

-std=c++11 -Wall -Werror -pedantic-errors -Lgfx -lgfx -lX11 -lm -pthread -DNDEBUG

How to Launch

Open the executable file "snake". The game window is supposed to appear immediately.

Rules

Navigation is done using the 'w', 'a', 's', 'd' keys. Use 'q' in order to quit and close the window. For each fruit you cross in your movement, one point will be added to your score, but the speed will be increased too. In the beginning of each game, you start with 3 lives. A life is deduced whenever the snake crosses itself. Once all the lives are over, the game ends. Moreover, whenever the snake exits the boundaries of the window, the game ends as well.

Screenshot

snake's People

Contributors

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