示例#1
0
        public override void Die()
        {
            if (IsExploding)
            {
                return;
            }
            IsExploding = true;
            DieTexture.ToStart();
            Game.Sounds.BallBounce.Play();
            PlayArena.Vaus.AddScore(Scoring.Alien);
            DieTexture.SetAnimation(AnimationState.Play);


            DieTexture.OnFinish = () =>
            {
                DieTexture.SetAnimation(AnimationState.Stop);
                PlayArena.AddNewEnimies(new[]
                {
                    new Enemy(Game, PlayArena, Sprites.EnmOrbRed, Sprites.EnmDieOrbTri, Location, Direction.Left),
                    new Enemy(Game, PlayArena, Sprites.EnmOrbGreen, Sprites.EnmDieOrbTri, Location, Direction.Right),
                    new Enemy(Game, PlayArena, Sprites.EnmOrbBlue, Sprites.EnmDieOrbTri, Location)
                });
                Location    = new Vector2(Location.X, Game.Height);
                IsExploding = false;
                Life        = 0;
            };
        }
示例#2
0
 public virtual void Die()
 {
     if (IsExploding)
     {
         return;
     }
     IsExploding = true;
     DieTexture.ToStart();
     Game.Sounds.BallBounce.Play();
     PlayArena.Vaus.AddScore(Scoring.Alien);
     DieTexture.SetAnimation(AnimationState.Play);
     DieTexture.OnFinish = () =>
     {
         DieTexture.SetAnimation(AnimationState.Stop);
         Location    = new Vector2(Location.X, Game.Height);
         IsExploding = false;
         Life        = 0;
     };
 }