From 0c771c88f03103d0427d76123c030a29bd4ba513 Mon Sep 17 00:00:00 2001 From: Gabriele Cirulli Date: Wed, 12 Mar 2014 13:15:10 +0100 Subject: [PATCH 1/3] add mentions to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index f2cdfa8..97f784a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ 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)](http://pictures.gabrielecirulli.com/2048-20140309-234100.png) That screenshot is fake, by the way. I never reached 2048 :smile: From a862d448490316bc0dd7e86359e2b5ff4dd9a88a Mon Sep 17 00:00:00 2001 From: Gabriele Cirulli Date: Wed, 12 Mar 2014 13:15:38 +0100 Subject: [PATCH 2/3] add screnshot section --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 97f784a..fe2ba5b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/) 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) That screenshot is fake, by the way. I never reached 2048 :smile: From 88278792be80739c303968d2e4ff31a4eba317b6 Mon Sep 17 00:00:00 2001 From: Gabriele Cirulli Date: Wed, 12 Mar 2014 13:30:50 +0100 Subject: [PATCH 3/3] small change in scoremanager --- js/local_score_manager.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/local_score_manager.js b/js/local_score_manager.js index 7e35cd1..fe9b625 100644 --- a/js/local_score_manager.js +++ b/js/local_score_manager.js @@ -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) {