From dc0b7f95914e44ed2afd1bc2f7973c8d8fb1016a Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 00:35:28 +0000 Subject: [PATCH] Add scene heartbeat diagnostics --- src/game-v4.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/game-v4.js b/src/game-v4.js index af50ac6..d284092 100644 --- a/src/game-v4.js +++ b/src/game-v4.js @@ -46,6 +46,7 @@ class GameScene extends Phaser.Scene { this.lastPlayerShot = 0; this.lastPlayerHitAt = -Infinity; this.pendingPlayerHits = []; + this.lastDiagnosticsAt = -Infinity; this.wave = 1; this.defeated = 0; @@ -354,6 +355,20 @@ class GameScene extends Phaser.Scene { return; } + if (this.time.now - this.lastDiagnosticsAt >= 1000) { + this.lastDiagnosticsAt = this.time.now; + airshipLog('scene:heartbeat', { + gameState: this.gameState, + hull: this.playerHull, + pendingHits: this.pendingPlayerHits.length, + activePirates: this.pirates?.countActive?.(true) || 0, + playerShots: this.playerShots?.countActive?.(true) || 0, + pirateShots: this.pirateShots?.countActive?.(true) || 0, + wave: this.wave, + now: this.time.now, + }, 'debug'); + } + this.updatePlayer(dt, deltaMs); this.updatePirates(dt); this.updateProjectiles();