Skip to content

Commit

Permalink
Added bot score screan
Browse files Browse the repository at this point in the history
  • Loading branch information
miraz12 committed Oct 2, 2023
1 parent 86adfb6 commit 2eb4dac
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions code/src/Game/States/ScoreState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ export default class LobbyState extends State {
playersMap.set("Player_" + key, value.ascendTime - startTime);
}
);
const mapSort = new Map(
[...playersMap.entries()].sort((a, b) => a[1] - b[1])
);
mapSort.forEach((value: number, key: string) => {
this.addParticipant(
key + " Time: " + Math.round(value) * 0.001 + " Seconds"
);
});
} else {
playersMap.set(
"(You)",
Game.getInstanceNoSa().allCharacterDict.player.ascendTime - startTime
);
let idx = 0;
for (const bot of Game.getInstanceNoSa().allCharacterDict.bots) {
playersMap.set("Bot_" + idx, bot.ascendTime - startTime);
}

const mapSort = new Map(
[...playersMap.entries()].sort((a, b) => a[1] - b[1])
);
Expand Down

0 comments on commit 2eb4dac

Please sign in to comment.