### 中文介绍 请查看 [README.md](https://github.com/binaryify/vue-tetris/blob/master/README.md) ---- ## Use Vue, Vuex to code Tetris. Inspired by [react-tetris](https://github.com/chvin/react-tetris), cause I prefer Vue to React, so I use Vue to code it, my idea is to think of components and methods as functions, to ensure that an input (props/params) gets a determined output (view/return value), and use Vuex instead of Redux. Open [http://binaryify.github.io/vue-tetris/](http://binaryify.github.io/vue-tetris/) to play! ### Responsive ![Responsive](https://img.alicdn.com/tps/TB1AdjZNXXXXXcCapXXXXXXXXXX-480-343.gif) Not only refers to the screen adaptation, `but the change of input depending on your platform, use of the keyboard in the PC and in the phone using the touch as input`: ![phone](https://img.alicdn.com/tps/TB1kvJyOVXXXXbhaFXXXXXXXXXX-320-555.gif) ### Data persistence ![previes](http://static.binaryify.com/persistence.gif) [video](https://www.youtube.com/watch?v=SzTNX7rg9Qg) What's the worst can happen when you're playing stand-alone games? Power outage. The state is stored in the `localStorage` by subscribing to `store.subscribe`, which records exactly all the state. Web page refreshes, the program crashes, the phone is dead, just re-open the connection and you can continue playing. ### Vuex state preview ([Vue DevTools extension](https://github.com/vuejs/vue-devtools)) ![preview](http://static.binaryify.com/vuex.gif) [video](https://www.youtube.com/watch?v=iuoSSTqSAUE) Vuex manages all the state that should be stored, which is a guarantee to be persisted as mentioned above. ---- The Game framework is the use of [Vue](https://github.com/vuejs/vue) + [Vuex](https://github.com/vuejs/vuex) ### Acquaintance: ## 1. Web Audio Api There are many different sound effects in the game, but in fact we keep only a reference to a sound file: [/build/music.mp3](https://github.com/binaryify/vue-tetris/blob/master/build/music.mp3). With the help of `Web Audio Api`, you can play audio in millisecond precision, with a high frequency, which is not possible with the `