Skip to content

Commit 2636040

Browse files
committed
Highlight current score in score screen.
1 parent eb2072a commit 2636040

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nodes/ScoreScreen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ export default class ScoreScreen extends GameNode {
135135
highScoresLabel.anchor = { x: 0.5, y: 0.5 };
136136
this.view.addChild(highScoresLabel);
137137
for (let [i, entry] of scores.slice(0, 8).entries()) {
138-
this.showEntry(i, entry, -200 + i * 60);
138+
this.showEntry(i, entry, -200 + i * 60, i === index);
139139
}
140-
this.showEntry(index, newEntry, -200 + 9 * 60);
140+
this.showEntry(index, newEntry, -200 + 9 * 60, true);
141141
}
142142

143-
showEntry(index: number, entry: Score, position: number) {
143+
showEntry(index: number, entry: Score, position: number, highlight = false) {
144144
const nameText = new HTMLText({
145145
text: `${(index + 1 + "").padStart(3)} ${entry.name}`,
146146
style: {
147147
fontFamily: TEXT_FONT,
148-
fill: theme.colors.primary,
148+
fill: highlight ? theme.colors.primary : theme.colors.muted,
149149
fontSize: 48,
150150
fontWeight: "bold",
151151
},

0 commit comments

Comments
 (0)