8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 869d07b commit 773382aCopy full SHA for 773382a
js/game.js
@@ -71,7 +71,9 @@ class Game {
71
this.invulnerabilityTime = 2.0;
72
this.invulnerabilityTimer = 0;
73
this.score = 0;
74
- this.highScore = parseInt(localStorage.getItem('highScore')) || 0;
+ this.highScore = localStorage.getItem('highScore')
75
+ ? parseInt(localStorage.getItem('highScore'), 10)
76
+ : 0;
77
this.lives = 3;
78
79
// Initialize music player without starting it
@@ -407,7 +409,7 @@ class Game {
407
409
this.score += points;
408
410
if (this.score > this.highScore) {
411
this.highScore = this.score;
- localStorage.setItem('highScore', this.highScore.toString());
412
+ localStorage.setItem('highScore', this.highScore.toString()); // Store high score to local storage
413
}
414
415
0 commit comments