diff --git a/js/webtris.js b/js/webtris.js index a4af987..1951475 100644 --- a/js/webtris.js +++ b/js/webtris.js @@ -271,8 +271,7 @@ class Stats { constructor () { this.div = document.getElementById("stats-values") this._score = 0 - this.lastHighScore = localStorage.getItem('highScore') || 0 - this.highScore = this.lastHighScore + this.highScore = localStorage.getItem('highScore') || 0 this.goal = 0 this.linesCleared = 0 this.startTime = Date.now() @@ -602,8 +601,8 @@ function gameOver() { scheduler.clearInterval(clock) requestAnimationFrame(draw) - if (stats.score > stats.lastHighScore) { - alert("Bravo ! Vous avez battu votre meilleur score.") + if (stats.score == stats.highScore) { + alert("Bravo ! Vous avez battu votre précédent record.") localStorage.setItem('highScore', stats.highScore) } } diff --git a/webtris.html b/webtris.html index dfcd9e1..eb86484 100644 --- a/webtris.html +++ b/webtris.html @@ -19,7 +19,7 @@
SCORE
- MEILLEUR
+ RECORD
TEMPS
NIVEAU
OBJECTIF