Giter Site home page Giter Site logo

tdjs2048's Introduction

TDJS 2048

  • A Board
    • Is 4x4
    • Can have new tiles randomly placed
  • There is a scoring system
    • Initial value 0
    • The value is the sum of all combined tiles
    • A random tile gives points only when combined with another
  • There is a high score system
    • That shows the best score of the current player
    • That is updated when the points reach above the previous high score
  • A move is
    1. Move all tiles as far as possible a chosen direction (up down left right)
    2. Collision handling
    3. Points calculation
    4. Spawn a new random tile
    5. Game end check
  • Two initial tiles
    • With random placement
    • In descending probability a combination of: 2,2; 2,4 or 4,4
    • Tiles are colour coded (1-1 points-colour)
    • Recreated on a new game
  • Moves are made with the arrow keys
    • A new tile is spawned (either 2 or 4, where 2 is more common) randomly on an empty spot
    • At most two tiles on the same row or column is combined into one, examples:
      • 2222 R => --44
      • 2228 R => -248
      • 2-28 R => --48
    • If two tiles of the same value collide, they create a tile with the sum of the two, examples
      • 2+2 = 4
      • 4+4 = 8
      • 1024+1024 = 2048
      • 2002 R => 0004
      • 0222 R => 0024
    • Arrow : all tiles are moved in , example (moving Right):
      • 0000 0000 0200 0002 0020 0002 0000 0000
  • Game ends
    • With victory if a tile has a value of 2048
    • With a score if it is no longer possible to combine tiles doing a move
  • Game keeps its state
    • when it is opened in a new tab
    • when it is reloaded (page reload)

tdjs2048's People

Watchers

Lars-Henrik Snow 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.