Skip to content

Commit

Permalink
Merge Attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Feb 3, 2016
1 parent 05fff92 commit 5bf94eb
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,29 +147,19 @@ $(document).ready(function() {
die.pause();
die.play();
}
<<<<<<< HEAD

storage = localStorage.setItem('topScore', highscore);
$(".currentScore").text("Your score: " + score);
$("#highScore").text(localStorage.topScore);
if(score > localStorage.getItem('topScore')){
highscore ++;
}
=======
var storedHighscore = 0;
localStorage.setItem("highscore", highscore);
$(".currentScore").text("Your score: " + score);
if(score > highscore) {
highscore ++;
if (score > storedHighscore && localStorage.highscore !== undefined) {
localStorage.highscore = storedHighscore;
} else if(score > storedHighscore && localStorage.highscore === undefined){
storedHighscore++;
localStorage.highscore = storedHighscore;
}
}
$("#highScore").text(highscore);
>>>>>>> master
localStorage.setItem("highscore", highscore);
$(".currentScore").text("Your score: " + score);
if(score > highscore) {
highscore ++;
if (score > storedHighscore && localStorage.highscore !== undefined) {
localStorage.highscore = storedHighscore;
} else if(score > storedHighscore && localStorage.highscore === undefined){
storedHighscore++;
localStorage.highscore = storedHighscore;
}
}
$("#highScore").text(highscore);

if(newX === food.x && newY === food.y){
tail = {x: newX, y: newY};
Expand Down

0 comments on commit 5bf94eb

Please sign in to comment.