Exemple #1
0
        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
                }
            }
        }
Exemple #2
0
        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));
            }
        }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
        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));
            }
        }