Merge branch 'master' into gh-pages
This commit is contained in:
@@ -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/)
|
||||
|
||||
### 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
|
||||
|
||||
[](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)
|
||||
|
||||
That screenshot is fake, by the way. I never reached 2048 :smile:
|
||||
|
||||
@@ -19,11 +19,7 @@ function LocalScoreManager() {
|
||||
}
|
||||
|
||||
LocalScoreManager.prototype.get = function () {
|
||||
var score = this.storage.getItem(this.key);
|
||||
if (typeof score === "undefined" || score === null) {
|
||||
score = 0;
|
||||
}
|
||||
return score;
|
||||
return this.storage.getItem(this.key) || 0;
|
||||
};
|
||||
|
||||
LocalScoreManager.prototype.set = function (score) {
|
||||
|
||||
Reference in New Issue
Block a user