|
|
@ -109,22 +109,28 @@ class Game {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let x = 32;
|
|
|
|
let x = 16;
|
|
|
|
let y = 90;
|
|
|
|
let y = 48;
|
|
|
|
let rowHeight = 32;
|
|
|
|
let rowHeight = 32;
|
|
|
|
let rowWidth = 128;
|
|
|
|
let rowWidth = 128;
|
|
|
|
|
|
|
|
|
|
|
|
let row = 0;
|
|
|
|
let scores = [];
|
|
|
|
for (let id in this.players) {
|
|
|
|
for (let id in this.players) {
|
|
|
|
let player = this.players[id];
|
|
|
|
let player = this.players[id];
|
|
|
|
|
|
|
|
scores.push(player);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
scores.sort((p1, p2) => { return p2.score - p1.score; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let row = 0;
|
|
|
|
|
|
|
|
for (let player of scores) {
|
|
|
|
tint(Colors.Purple);
|
|
|
|
tint(Colors.Purple);
|
|
|
|
image(player.image, x, y + row * rowHeight, 32, 32);
|
|
|
|
image(player.image, x, y + row * rowHeight, 32, 32);
|
|
|
|
|
|
|
|
|
|
|
|
textSize(24);
|
|
|
|
textSize(24);
|
|
|
|
fill(Colors.Purple);
|
|
|
|
fill(Colors.Purple);
|
|
|
|
noStroke();
|
|
|
|
noStroke();
|
|
|
|
textAlign(LEFT, CENTER);
|
|
|
|
textAlign(LEFT, TOP);
|
|
|
|
text(player.score, x + 32 + 10, y + rowHeight*0.5);
|
|
|
|
text(player.score, x + 42, y + row * rowHeight + 4);
|
|
|
|
row++;
|
|
|
|
row++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|