GithubHelp home page GithubHelp logo

2048-vue's Introduction

2048-vue

About

a clone of 2048 game

Technology stack

  • Vue 2
  • Vuex
  • Vanilla JavaScript

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Run test

npm run test:unit

Features

  • A board that is randomly populated with two tiles

  • The game can be stored across browser sessions

  • Move the tiles when user presses arrow keys

  • Generate new tiles for every turn

  • Merge two colliding tiles into one

  • Touch/mobile support

  • Display a message when the game is β€˜won’ or 'game over'

  • The number of row and column, the goal, and the amout of undo can be configured

  • The current score and best score

  • Restart the game and undo

TODO

  • More Tests
  • Offline play
 tiles: [
   { row: 0, column: 0, value: 2 },
   { row: 0, column: 1, value: 4 },
   { row: 0, column: 2, value: 8 },
   { row: 0, column: 3, value: 16 },
   { row: 1, column: 0, value: 32 },
   { row: 1, column: 1, value: 64 },
   { row: 1, column: 2, value: 128 },
   { row: 1, column: 3, value: 256 },
   { row: 2, column: 0, value: 512 },
   { row: 2, column: 1, value: 1024 },
   { row: 2, column: 2, value: 2048 },
   { row: 2, column: 3, value: 4096 },
   { row: 3, column: 0, value: 8192 },
   { row: 3, column: 1, value: 16384 },
   { row: 3, column: 2, value: 32768 },
   { row: 3, column: 3, value: 65536 },
 ],


 grids: [
   [2, 4, 8, 16],
   [32, 64, 128, 256],
   [512, 1024, 2048, 4096],
   [8192, 16384, 32768, 65536],
 ],

2048-vue's People

Contributors

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