Skip to content

Commit

Permalink
remove localstorage of achievements
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnu7 committed Feb 6, 2016
1 parent 7159594 commit 957cfef
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/PlayGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,6 @@ exports = (function() {
var obj = {},
busy = false,
json = JSON.parse(CACHE['resources/conf/play_game.json']),
// achievements
/*
isAchieved = function(val) {
var ls = localStorage.getItem("record_achieved");
ls = ls ? JSON.parse(ls) : [];
if(ls.indexOf(val) != -1) {
return true;
}
return false;
},
setAchieved = function(val) {
var ls = localStorage.getItem("record_achieved");
ls = ls ? JSON.parse(ls) : [];
ls.push(val);
localStorage.setItem("record_achieved", JSON.stringify(ls));
},
// leaderboards
getCurrentRecord = function(type) {
var ls = localStorage.getItem('record_' + type);
return ls ? parseInt(ls, 10): 0;
},
setRecord = function(type, value) {
localStorage.setItem('record_' + type, value);
},
*/
setLoggedIn = function(value) {
localStorage.setItem('playgame', value);
};
Expand Down Expand Up @@ -82,6 +57,9 @@ exports = (function() {
};

obj.achievement = function(val, mode) {
if(!obj.isLoggedIn()) {
return;
}
var achievements = mode === 'time' ? json.achievements_time : json.achievements;
if(achievements.hasOwnProperty(val)) {
obj.run({
Expand Down

0 comments on commit 957cfef

Please sign in to comment.