예제 #1
0
        private void Die()
        {
            UIObjects.GameOver = true;
            GameOver GO = new GameOver();

            GO.Show();
        }
예제 #2
0
 private void CheckPositionInvaders(List <UIElement> invaders)
 {
     foreach (var inv in invaders)
     {
         var invaderPosition = new Point
         {
             X = Canvas.GetLeft(inv),
             Y = Canvas.GetTop(inv)
         };
         if (invaderPosition.Y > 400)
         {
             UIObjects.GameOver = true;
             GameOver GO = new GameOver();
             GO.Show();
         }
     }
 }
예제 #3
0
        private void CheckOnNewWave()
        {
            if (UIObjects.newWave)
            {
                UIObjects.InvaderList.Clear();
                _t.Stop();
                _top = 0;
                if (_notifyHandler.Waves >= 29)
                {
                    _notifyHandler.GoldAmount += 2000;
                    _invaderCountRows          = 0;
                    _invadersRows              = 0;
                    UIObjects.GameOver         = true;
                    GameOver GO = new GameOver();
                    GO.Show();
                }
                if (_notifyHandler.Waves >= 24)
                {
                    _notifyHandler.GoldAmount += 1000;
                    _invaderCountRows          = 6;
                    _t.Interval = _speed2;
                }
                if (_notifyHandler.Waves == 19)
                {
                    _invadersRows              = 7;
                    _invaderCountRows          = 6;
                    _notifyHandler.GoldAmount += 800;
                }
                else if (_notifyHandler.Waves == 14)
                {
                    _invadersRows              = 6;
                    _invaderCountRows          = 6;
                    _notifyHandler.GoldAmount += 600;
                }
                else if (_notifyHandler.Waves == 9)
                {
                    _invadersRows              = 5;
                    _invaderCountRows          = 6;
                    _notifyHandler.GoldAmount += 400;
                }
                else if (_notifyHandler.Waves == 4)
                {
                    _invadersRows              = 4;
                    _invaderCountRows          = 6;
                    _notifyHandler.GoldAmount += 300;
                }
                else
                {
                    _invaderCountRows         += 1;
                    _notifyHandler.GoldAmount += 200;
                    _notifyHandler.Bullets     = 75;
                }
                if (_notifyHandler.Waves % 5 == 0)
                {
                    _notifyHandler.Bombs = 3;
                }
                _notifyHandler.Waves += 1;

                UIObjects.newWave = false;
                CreateNewWave();
            }
        }