提交 52979f12 编写于 作者: G Gabriele Cirulli

Merge branch 'master' into gh-pages

...@@ -3,6 +3,15 @@ A small clone of [1024](https://play.google.com/store/apps/details?id=com.veewo. ...@@ -3,6 +3,15 @@ A small clone of [1024](https://play.google.com/store/apps/details?id=com.veewo.
Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/) Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/)
### Contributions
- [TimPetricola](https://github.com/warmwaffles) added best score storage
- [chrisprice](https://github.com/chrisprice) added custom code for swipe handling on mobile
Many thanks to [rayhaanj](https://github.com/rayhaanj), [Mechazawa](https://github.com/Mechazawa), [grant](https://github.com/grant), [remram44](https://github.com/remram44) and [ghoullier](https://github.com/ghoullier) for the many other good contributions.
### Screenshot
[![Screenshot](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)](http://pictures.gabrielecirulli.com/2048-20140309-234100.png) [![Screenshot](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)
That screenshot is fake, by the way. I never reached 2048 :smile: That screenshot is fake, by the way. I never reached 2048 :smile:
......
...@@ -19,11 +19,7 @@ function LocalScoreManager() { ...@@ -19,11 +19,7 @@ function LocalScoreManager() {
} }
LocalScoreManager.prototype.get = function () { LocalScoreManager.prototype.get = function () {
var score = this.storage.getItem(this.key); return this.storage.getItem(this.key) || 0;
if (typeof score === "undefined" || score === null) {
score = 0;
}
return score;
}; };
LocalScoreManager.prototype.set = function (score) { LocalScoreManager.prototype.set = function (score) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册