public override void OnCollisionPlayerBullet(PlayerBullet playerBullet) {//mine takes damage life -= 1; if (life == 0) { isDead = true; game.explosions.Add(new Explosion(x, y)); foreach (Mine mine in mines) { mine.OnCollisionPlayer(); //kills all mines when this dies } } }
public virtual void OnCollisionPlayerBullet(PlayerBullet playerBullet) { life -= 1; if (life == 0) { isDead = true; game.explosions.Add(new Explosion(x, y)); } if (playerBullet is MissileBullet) {//extra sounds and effects if hit by a missile Sound.Play(Sound.explosion); game.explosions.Add(new Explosion(playerBullet.x, playerBullet.y)); } }
public override void OnCollisionPlayerBullet(PlayerBullet playerBullet) { if (state == State.Appear || state == State.Swoon || state == State.Dying) { return; } life -= 1; if (life <= 0) { state = State.Dying; } else if (state == State.Normal && life <= 300) { state = State.Swoon; } }
public override void OnCollisionPlayerBullet(PlayerBullet playerBullet) {//boss takes damage if (state == State.Appear || state == State.Swoon || state == State.Dying) { return; } life -= 1; if (life <= 0) { state = State.Dying; } if (playerBullet is MissileBullet) {//extra sounds and effects if hit by a missile Sound.Play(Sound.explosion); game.explosions.Add(new Explosion(playerBullet.x, playerBullet.y)); } }