Skip to content

Commit

Permalink
Update gameover.js
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleciondolo authored May 15, 2024
1 parent acfc206 commit 80b6190
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/gameover.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GameOver.prototype = {
this.scoreLabel.anchor.setTo(0.5, 0.5);
this.scoreLabel.align = 'center';
this.game.world.bringToTop(this.scoreLabel);
this.scoreLabel.text = "Your score is " + (score);
this.scoreLabel.text = "Il tuo punteggio è di " + (score);

this.highScore = this.game.add.text(this.game.world.centerX
, this.game.world.centerY, "0", { font: scoreFont, fill: "#fff" });
Expand All @@ -42,11 +42,11 @@ GameOver.prototype = {
this.hs = window.localStorage.getItem('HighScore');

if (this.hs == null) {
this.highScore.setText("High score: " + score);
this.highScore.setText("Massimo Punteggio : " + score);
window.localStorage.setItem('HighScore', score)
}
else if (parseInt(this.hs) < score) {
this.highScore.setText("High score: " + (score ));
this.highScore.setText("Massimo Punteggio : " + (score ));
window.localStorage.setItem('HighScore', score)

}
Expand All @@ -56,7 +56,7 @@ GameOver.prototype = {

this.restart = this.game.add.text(this.game.world.centerX
, this.game.world.centerY * 1.5
, "Press \n Space to retry ", { font: scoreFont, fill: "#fff" });
, "Premi \n per riprovà zi! ", { font: scoreFont, fill: "#fff" });
this.restart.anchor.setTo(0.5, 0.5);
this.restart.align = 'center';
this.game.world.bringToTop(this.restart);
Expand All @@ -68,4 +68,4 @@ GameOver.prototype = {
this.game.state.start("Main");
}

}
}

0 comments on commit 80b6190

Please sign in to comment.