Giter VIP home page Giter VIP logo

snake's Introduction

Game Description:

Press w/a/s/d to control the snake. If the snake eats an apple, it gains 100 scores. It the snake hits wall or itself, and has no extra lives, it dies.

Press p to pause the game. If the game is paused, press p to resume the game and keep the snake’s direction as before the pause, or press w/a/s/d to resume the game and change the snake’s direction.

Press r to restart the game at any time (i.e. while playing, paused, and/or dead).

Default FPS = 60
Default speed = 5


Enhancements:

I have added two power-ups into the game.

1. Golden Apple - If the snake eats a golden apple, it gains an extra life. The possibility of generating a golden apple is 10%.
2. Purple Apple - If the snake eats a purple apple, its speed decreases by 1 (Minimum = 1). If player restarts the game, snake’s speed is reset to default (or the given speed from command line). The possibility of generating a purple apple is 6%.

For easier test of the special apples, you can keep press r until they show.

I have also drawn a snake and apples with fillrectangle, which I am not sure if they can be counted as texture graphics.


Development Environment:

macOS Sierra
version 10.12.2

snake's People

Contributors

lwx940710 avatar

Stargazers

Areeshaa Parveen 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.