From 6824910c5121c4b8343a9870c32a13530ccce26e Mon Sep 17 00:00:00 2001 From: "julien.bouin.etu" <julien.bouin.etu@univ-lille.fr> Date: Sun, 7 Apr 2024 11:50:25 +0200 Subject: [PATCH] correction bugs --- client/src/scoreboard.json | 30 ++++++++---------------------- server/index.js | 5 ++--- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/client/src/scoreboard.json b/client/src/scoreboard.json index 6dff0e9..1f14fbd 100644 --- a/client/src/scoreboard.json +++ b/client/src/scoreboard.json @@ -1,42 +1,28 @@ { "results": [ { - "nom": "Joueur 1", - "score": 100 - }, - { - "score": -15 - }, - { - "nom": "dd", - "score": -15 - }, - { - "score": -15 - }, - { + "nom": "julien", "score": -15 }, { - "nom": "dd", + "nom": "julien", "score": -15 }, { - "nom": "dd", + "nom": "julien", "score": -15 }, { - "score": -15 + "nom": "julien2", + "score": -10 }, { - "score": -15 + "nom": "j", + "score": -10 }, { - "nom": "dd", + "nom": "test", "score": -15 - }, - { - "score": -10 } ] } \ No newline at end of file diff --git a/server/index.js b/server/index.js index 1c0dea2..d453023 100644 --- a/server/index.js +++ b/server/index.js @@ -163,6 +163,8 @@ let spawnBonusInterval = setInterval(() => { }, 15000); setInterval(() => { + scores = gestionScore.afficherScores(); + io.emit('scores', scores); io.emit('enemis', enemis); io.emit('bonusArray', bonusArray); @@ -193,9 +195,6 @@ setInterval(() => { }, 100); } if (avatar.getVies() == 0) { - scores = gestionScore.afficherScores(); - io.emit('scores', scores); - gestionScore.ajouterScore(avatar.pseudo, avatar.score); avatar.setSpectateur(); -- GitLab