Fix pirate cannon impact feedback on player

This commit is contained in:
Admin 2026-09-17 23:13:47 +00:00
parent 6b21c1ce6f
commit 6555caca58

View File

@ -416,6 +416,11 @@ class GameScene extends Phaser.Scene {
const { x, y } = shot;
shot.destroy();
// Always show projectile impact feedback. Damage is still rate-limited so
// one three-shot broadside cannot register as three hull hits.
this.spawnExplosion(x, y, 0.32);
this.flashShip(this.player, 0xffcccc);
if (this.time.now - this.lastPlayerHitAt < PLAYER_HIT_COOLDOWN_MS) return;
this.lastPlayerHitAt = this.time.now;
@ -423,11 +428,7 @@ class GameScene extends Phaser.Scene {
if (this.playerHull <= 0) {
this.finishGame();
return;
}
this.spawnExplosion(x, y, 0.28);
this.flashShip(this.player, 0xffcccc);
}
spawnExplosion(x, y, scale = 1) {