Code Monkey home page Code Monkey logo

snake-game's Introduction

Rules of the game:

1. The player controls the movement of the snake, which crawls around the square field: up, down, right and left.
2. The snake cannot be stopped.
3. The goal of the game is to eat as many apples as possible, which appear in turn, in a random place on the playing field, as soon as the snake "swallows" the previous one.
4. With each new apple, the snake grows by one segment (occupies one cell more). In our game, at the start, the snake occupies three cells (it has three segments) and can grow up to 28.
5. As the snake grows, the speed of the game increases.
6. The snake cannot pass "through itself" or go out of the playing field.
7. The game ends in victory if the length of the snake has increased to 28 segments.
8. The game ends in a loss if it touches itself or the edge of the field.

The "game engine" logic and classes are in the com.javarush.engine.cell package, and in order to use them, the SnakeGame class must contain the following import:
import com.javarush.engine.cell.*;

snake-game's People

Contributors

soykasloyka avatar

Stargazers

Leo Hannolainen 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.