Skip to content

Commit ca9c111

Browse files
thaglerclaude
andcommitted
Show level in top bar and level-complete overlay
Wire updateLevelName in GameScene so the HUD top bar displays the current level next to the enemies counter. Pass level in levelStats so the level-complete popup shows it at the top of the stats list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 101403d commit ca9c111

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/scenes/GameScene.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export class GameScene extends Phaser.Scene {
111111
this.hud.updateCredits(this.economyManager.getCredits());
112112
this.hud.updateLives(this.lives, this.maxLives);
113113
this.hud.updateEnemiesRemaining(this.totalEnemies);
114+
this.hud.updateLevelName(this.levelConfig.level, this.levelConfig.name);
114115
this.towerPicker.updateAffordability(this.economyManager.getCredits());
115116

116117
// ---- Build slot click handling ----
@@ -333,6 +334,7 @@ export class GameScene extends Phaser.Scene {
333334
creditsEarned: stats.totalEarned,
334335
livesRemaining: this.lives,
335336
livesMax: this.maxLives,
337+
level: this.level,
336338
};
337339

338340
if (this.level >= maxLevel) {

src/ui/HUD.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,15 @@ export class HUD extends Phaser.Events.EventEmitter {
274274
container.add(titleText);
275275

276276
// Stats lines
277-
const statsLines: string[] = [
278-
`Enemies Killed: ${stats.enemiesKilled}`,
279-
`Credits Earned: ${stats.creditsEarned}`,
280-
];
281-
if (stats.livesRemaining !== undefined && stats.livesMax !== undefined) {
282-
statsLines.push(`Lives Remaining: ${stats.livesRemaining}/${stats.livesMax}`);
283-
}
277+
const statsLines: string[] = [];
284278
if (stats.level !== undefined) {
285279
statsLines.push(`Level: ${stats.level}`);
286280
}
281+
statsLines.push(`Enemies Killed: ${stats.enemiesKilled}`);
282+
statsLines.push(`Credits Earned: ${stats.creditsEarned}`);
283+
if (stats.livesRemaining !== undefined && stats.livesMax !== undefined) {
284+
statsLines.push(`Lives Remaining: ${stats.livesRemaining}/${stats.livesMax}`);
285+
}
287286

288287
let lineY = centerY - 50;
289288
for (const line of statsLines) {

0 commit comments

Comments
 (0)