1
0
Fork 0

Fix scoreboard sort

This commit is contained in:
Ethanell 2021-03-26 23:11:35 +01:00
parent 8c067f1a3a
commit 2f08db7f09

View file

@ -110,7 +110,7 @@ function updateLives(l) {
function reloadScoreBoard() { function reloadScoreBoard() {
scoreBoard.querySelectorAll("div").forEach(d => d.remove()); scoreBoard.querySelectorAll("div").forEach(d => d.remove());
for (const s of scores.sort(s => s.score).reverse()) { for (const s of scores.sort((a, b) => a.score - b.score).reverse()) {
const e = document.createElement("div"); const e = document.createElement("div");
e.classList.add("row-score"); e.classList.add("row-score");
const p1 = document.createElement("p"); const p1 = document.createElement("p");