Fix pirate cannon impact feedback on player
This commit is contained in:
parent
6b21c1ce6f
commit
6555caca58
@ -416,6 +416,11 @@ class GameScene extends Phaser.Scene {
|
|||||||
const { x, y } = shot;
|
const { x, y } = shot;
|
||||||
shot.destroy();
|
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;
|
if (this.time.now - this.lastPlayerHitAt < PLAYER_HIT_COOLDOWN_MS) return;
|
||||||
this.lastPlayerHitAt = this.time.now;
|
this.lastPlayerHitAt = this.time.now;
|
||||||
|
|
||||||
@ -423,11 +428,7 @@ class GameScene extends Phaser.Scene {
|
|||||||
|
|
||||||
if (this.playerHull <= 0) {
|
if (this.playerHull <= 0) {
|
||||||
this.finishGame();
|
this.finishGame();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.spawnExplosion(x, y, 0.28);
|
|
||||||
this.flashShip(this.player, 0xffcccc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnExplosion(x, y, scale = 1) {
|
spawnExplosion(x, y, scale = 1) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user