Giter VIP home page Giter VIP logo

game-2048's Introduction

Rules:

  • The game board is square. The standard board size is 4x4 tiles. The objective of the game is to get a tile whose value is 2048.
  • A tile with a value of 2 (probability of 90%) or 4 (probability of 10%) appears in each round.
  • You can shift all the tiles on the game board to one of the 4 sides by pressing the corresponding key: up, down, right, or left. If a shift causes two tiles with the same value to "collide", then they merge into one. The new value is the sum of the merged tiles. After each move, a new tile with a value of 2 or 4 appears in an empty space on the game board. If pressing a key does not cause the tiles to change locations or values, then no turn has been made.
  • If more than two tiles of the same value are in the same row or column, then they merge from the side from which they are being shifted. For example, after a shift to the left, the tiles (4, 4, 4, 0) in the same row become (8, 4, 0, 0). After a shift to the right, they become (0, 0, 4, 8). This way of handling ambiguity makes it possible to more accurately formulate a game strategy.
  • With each merger, the score increases by the value of the resulting tile.
  • The game is lost if no further moves are possible.
  • The game ends in victory if a tile with the value 2048 appears on the game board.

Future Tasks:

  • Change the size of the game board.
  • Continue the game even if a tile with the value 2048 is found.
  • Instead of the numbers 2 and 4 (powers of two), use Fibonacci numbers.
  • Add a "super-tile" that can merge with any existing tile on the game board.
  • Add visual effects (animation).

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.