diff --git a/src/game-v4.js b/src/game-v4.js index 9303196..a37c621 100644 --- a/src/game-v4.js +++ b/src/game-v4.js @@ -533,7 +533,12 @@ class GameScene extends Phaser.Scene { // happens from the scene update after the physics step; projectile cleanup // remains on the normal lifetime path to avoid collision-time lifecycle changes. shot.setData('playerHitQueued', true); - this.pendingPlayerHits.push({ shot, damage }); + this.pendingPlayerHits.push({ + shot, + damage, + x: shot.x, + y: shot.y, + }); airshipLog('combat:player-hit-queued', { damage, @@ -571,6 +576,23 @@ class GameScene extends Phaser.Scene { this.playerHull = result.hull; this.lastPlayerHitAt = result.lastHitAt; + if (result.appliedHits > 0) { + const impact = hits[0]; + try { + this.spawnExplosion(impact.x, impact.y, 0.32); + this.flashShip(this.player, 0xffcccc); + airshipLog('combat:player-hit-fx', { + x: Math.round(impact.x), + y: Math.round(impact.y), + scale: 0.32, + }, 'debug'); + } catch (error) { + airshipLog('combat:player-hit-fx-error', { + message: error?.message || String(error), + }, 'error'); + } + } + airshipLog('combat:player-hit-processed', { queuedHits: hits.length, appliedHits: result.appliedHits,