Isolate player hit collision from impact FX
This commit is contained in:
parent
beb8b976d3
commit
2f837d15e6
@ -433,13 +433,10 @@ class GameScene extends Phaser.Scene {
|
||||
|
||||
const rawDamage = Number(shot.getData('damage'));
|
||||
const damage = clamp(Number.isFinite(rawDamage) ? rawDamage : PIRATE_SHOT_DAMAGE, 1, 25);
|
||||
const { x, y } = shot;
|
||||
|
||||
// Mirror the proven player-shot collision path: remove the projectile
|
||||
// immediately, render impact feedback, then rate-limit hull damage only.
|
||||
// Keep enemy -> player collision deliberately side-effect-light until the
|
||||
// freeze is isolated. Projectile removal and hull mutation only.
|
||||
shot.destroy();
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user