Esempio n. 1
0
        private void ChangeScreens()
        {
            GameLayout.IsEnabled = !GameLayout.IsEnabled;
            MenuLayout.IsEnabled = !MenuLayout.IsEnabled;

            if (StartMenuLayout.IsEnabled)
            {
                StartMenuLayout.IsEnabled  = false;
                StartMenuLayout.Visibility = Visibility.Collapsed;
            }
            else if (_isGameOver)
            {
                _isGameOver           = !_isGameOver;
                GameLayout.Visibility = Visibility.Collapsed;
                MenuLayout.IsEnabled  = false;
                _isPaused             = true;
            }
            else if (_isLevelFinished)
            {
                _isLevelFinished      = !_isLevelFinished;
                GameLayout.Visibility = Visibility.Collapsed;
                MenuLayout.IsEnabled  = false;
                _isPaused             = true;
            }

            if (GameLayout.Visibility == Visibility.Visible)
            {
                GameLayout.Visibility = Visibility.Collapsed;
                MenuLayout.Visibility = Visibility.Visible;
                MenuLayout.Focus();
                _isPaused = true;
            }
            else
            {
                GameLayout.IsEnabled  = true;
                GameLayout.Visibility = Visibility.Visible;
                MenuLayout.Visibility = Visibility.Collapsed;
                Canvas1.Focus();
                _isPaused = false;
                TimerMoveAsync();
                BulletMoveAsync();
                HordeMoveAsync();
            }
        }