fix: use platform highscore key in snake
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
|
||||
let snake, dir, nextDir, food, score, highscore, running, paused, animId;
|
||||
|
||||
highscore = parseInt(localStorage.getItem('snake_hs') || '0');
|
||||
highscore = getHighscore('snake');
|
||||
highscoreEl.textContent = highscore;
|
||||
|
||||
function init() {
|
||||
@@ -109,7 +109,6 @@
|
||||
if (score > highscore) {
|
||||
highscore = score;
|
||||
highscoreEl.textContent = highscore;
|
||||
localStorage.setItem('snake_hs', highscore);
|
||||
}
|
||||
spawnFood();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user