Skip to content

Commit 1febbd3

Browse files
committed
Fix scoring on later levels.
1 parent 37a18ad commit 1febbd3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/nodes/Player.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,12 @@ export default class Player extends GameNode {
216216
}
217217
this.currentState = "pause";
218218
if (
219-
await this.board.resolve(campaign[this.#level].scoreBase, (score) => {
220-
this.score += score;
221-
})
219+
await this.board.resolve(
220+
campaign[Math.min(this.#level, campaign.length - 1)].scoreBase,
221+
(score) => {
222+
this.score += score;
223+
}
224+
)
222225
) {
223226
this.newCurrent();
224227
this.currentState = "game";

0 commit comments

Comments
 (0)