dimanche 3 mars 2019

How to set a high score in JavaScript game?

I have something like a speed typing game. It saves the score to a variable till the game starts again. I want to save this score as high score and when the user does the better just change the score. And list 10users by their score on a table ? How can i do that ? Thank you!

let score = 0;
// Here it sets the score to 0 again
function checkStatus() {
  if (!isPlaying && time === 0) {
    message.innerHTML = 'Game Over!!!';
    score = -1;
  }
}




Aucun commentaire:

Enregistrer un commentaire