I want to add a high score to my game. Right now I have this:
var score = 0;
var highscore = 0;
The score variable works but whenever I get
I just reviewed your code in http://jsfiddle.net/unb8yLj3/ and i couldn't find in what part you increase the score so when this part of code run score is 0 and localStorage.getItem("highscore") is 10 therefore it doesn't set highscore.
if (score > localStorage.getItem("highscore")) {
localStorage.setItem("highscore", score);
}
}
Is there another js file that does increase the score?