diff --git a/www/index.html b/www/index.html index 3b249ac..d583fb6 100644 --- a/www/index.html +++ b/www/index.html @@ -95,7 +95,7 @@ Name - Score + Kills Death Killer Error diff --git a/www/replay.mjs b/www/replay.mjs index abbb7fe..46912ba 100644 --- a/www/replay.mjs +++ b/www/replay.mjs @@ -182,7 +182,12 @@ class Replay { let tbody = this.results.querySelector("tbody") tbody.replaceChildren() - for (let tank of game.tanks) { + let byKills = Object.keys(game.tanks) + byKills.sort((a, b) => game.tanks[a].kills - game.tanks[b].kills) + byKills.reverse() + + for (let i of byKills) { + let tank = game.tanks[i] let tr = tbody.appendChild(document.createElement("tr")) let tdSwatch = tr.appendChild(document.createElement("td"))