diff --git a/README.md b/README.md index f2cdfa8ef25262d3cd625b6419c624fbb936edb6..fe2ba5bbd69712f3f1b550883d9d2f5b780c7551 100644 --- a/README.md +++ b/README.md @@ -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 + [![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: diff --git a/js/local_score_manager.js b/js/local_score_manager.js index 7e35cd166e9467d30724612fe10b451852006781..fe9b625391f38c37aaef2686338a7df9b592ccf0 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) {