Beispiel #1
0
 private void InvaderRow_Tick(object sender, EventArgs e)
 {
     if (!_mh.IsPaused)
     {
         if (!UIObjects.GameOver)
         {
             CheckCollision(UIObjects.InvaderList);
             CheckPositionInvaders(UIObjects.InvaderList);
             UIObjects.checkInvaderCount();
             CheckOnNewWave();
             InvaderShoot(UIObjects.InvaderList);
         }
     }
 }
        private void ShootApokalypse(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                position.Y -= ApokalypseSpeed;
                Canvas.SetTop(apokalypse, position.Y - 100);
                Canvas.SetLeft(apokalypse, position.X);

                UIObjects.CheckCollisionBetweenApokalypseInvader(canvas);

                if (position.Y < 100 || UIObjects.hasBeenHit)
                {
                    DeleteApokalypse();
                }
            }
        }
        private void ShootSuperNova(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                position.Y -= SupernovaSpeed;
                Canvas.SetTop(supernova, position.Y - 100);
                Canvas.SetLeft(supernova, position.X - 50);

                UIObjects.CheckCollisionBetweenSuperNovaInvader(canvas);

                if (position.Y < 65)
                {
                    DeleteSuperNova();
                }
            }
        }
        private void ShootVBomb(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                position.Y -= VBombSpeed;
                Canvas.SetTop(Vbomb, position.Y - 100);
                Canvas.SetLeft(Vbomb, position.X - 50);

                UIObjects.CheckCollisionBetweenVBombInvader(canvas);

                if (position.Y < 25 || UIObjects.hasBeenHit)
                {
                    DeleteVBomb();
                }
            }
        }
        private void ShootSuperLaser(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                position.Y -= bulletSpeed;
                Canvas.SetTop(SuperLaser, position.Y);
                Canvas.SetLeft(SuperLaser, position.X + 50);

                UIObjects.CheckCollisionBetweenSuperLaserInvader(canvas);

                if (position.Y < 0)
                {
                    DeleteSuperLaser();
                }
            }
        }
        public void Shoot(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                position.Y -= bulletSpeed;
                Canvas.SetTop(laser, position.Y);
                Canvas.SetLeft(laser, position.X + 50);

                UIObjects.CheckCollisionBetweenLaserInvader(canvas);

                if (position.Y < 0 || UIObjects.hasBeenHit)
                {
                    DeleteBullet();
                }
            }
        }
Beispiel #7
0
        private void Shoot(object sender, EventArgs e)
        {
            if (!_mh.IsPaused)
            {
                _invaderShootPos.Y += _bulletSpeed;


                Canvas.SetLeft(_laser, _invaderShootPos.X + (_invaderWidth / 2));
                Canvas.SetTop(_laser, _invaderShootPos.Y + 5);

                UIObjects.CheckCollisionBetweenInvLaserPlayer(_canvas);

                if (_invaderShootPos.Y > 642 || UIObjects.PlayerHasBeenHit)
                {
                    DeleteBullet();
                }
            }
        }