示例#1
0
 void MoveForward()
 {
     while (!EnemyManager.GetDescriptorStatus())
     {
     }
     label.Invoke(movement);
     if (label.Location.X < 0 || label.Location.Y < 0 || label.Location.Y > s.Height || label.Location.X > s.Width)
     {
         ShootingControl.StopPlease();
         ShootingControl.BulletsMovement -= this.MoveForward;
         ShootingControl.BulletExplode(this);
         ShootingControl.DontStopPlease();
     }
 }
示例#2
0
        void MoveAhead()
        {
            while (!EnemyManager.GetDescriptorStatus())
            {
            }
            label.Invoke(movement);
            distance++;
            if (distance >= 40)
            {
                OptimizeDirection();
                distance = 0;
            }
            Bullet b = null;
            bool   t = false;

            if (DangerBullets.Count != 0)
            {
                t = this.HitCheck(out b);
            }
            if (t || label.Location.X < 0 || label.Location.Y < 0 || label.Location.Y > s.Height || label.Location.X > s.Width)
            {
                while (!EnemyManager.GetDescriptorStatus())
                {
                }
                ShootingControl.StopPlease();
                EnemyManager.EnemyExplode(this);
                if (t)
                {
                    b.EnemyHit = true;
                    ShootingControl.BulletExplode(b);
                    b.Atpison();
                }
                EnemyManager.EnemiesMovement -= this.MoveAhead;
                ShootingControl.PewPew       -= this.AddPotentialKiller;
                ShootingControl.Boom         -= this.RemovePotentialKiller;
                ShootingControl.DontStopPlease();
            }
        }