Пример #1
0
        /// <summary>
        /// Updates the scene.
        /// </summary>
        /// <param name="gameTime">The GameTime.</param>
        public override void Update(GameTime gameTime)
        {
            if (_entityComposer.GameOver)
            {
                _blackBlend.IsEnabled = true;
                if (_blackBlend.IsCompleted)
                {
                    var endScene = SGL.QueryComponents <SceneManager>().Get <EndScene>();
                    endScene.Score = _entityComposer.Score;
                    endScene.AchievementManager = _entityComposer.AchievementManager;
                    SGL.QueryComponents <SceneManager>().ActiveScene = endScene;
                }
            }
            else
            {
                HandleInput(gameTime);
                if (!_achievementsOpen)
                {
                    _skyBox.Update(gameTime);
                    _entityComposer.Update(gameTime);
                    _scoreBoard.CurrentHealth = _entityComposer.Player.Health;
                    _scoreBoard.CurrentScore  = _entityComposer.Score;
                    _minimap.Update(gameTime);
                    _debugDisplay.Update(gameTime);
                }
            }

            _blackBlend.Update(gameTime);
            _achievementControl.Visible = _achievementsOpen;
            UIManager.Update(gameTime);
        }
Пример #2
0
        /// <summary>
        /// Updates the scene.
        /// </summary>
        /// <param name="gameTime">The GameTime.</param>
        public override void Update(GameTime gameTime)
        {
            _blackBlend.Update(gameTime);
            UIManager.Update(gameTime);

            if (_menuButton1.IsMouseDown(MouseButtons.Left))
            {
                SGL.QueryComponents <SceneManager>().ActiveScene = SGL.QueryComponents <SceneManager>().Get <GameScene>();
            }

            if (_menuButton3.IsMouseDown(MouseButtons.Left))
            {
                Application.Exit();
            }
        }
Пример #3
0
        /// <summary>
        /// Updates the scene.
        /// </summary>
        /// <param name="gameTime">The GameTime.</param>
        public override void Update(GameTime gameTime)
        {
            _blackBlend.Update(gameTime);

            if (Input.Keyboard.GetState().IsKeyDown(Keys.Enter))
            {
                SGL.QueryComponents <SceneManager>().ActiveScene = SGL.QueryComponents <SceneManager>().Get <MenuScene>();
            }

            float achievementLvl = AchievementManager.Achievements.Sum(achievement => achievement.CurrentLevel);

            achievementLvl /= AchievementManager.Achievements.Count;

            _achievmentMultiplier = achievementLvl;

            _finalScore = (int)(Score * achievementLvl);
        }
Пример #4
0
 /// <summary>
 /// Updates the scene.
 /// </summary>
 /// <param name="gameTime">The GameTime.</param>
 public override void Update(GameTime gameTime)
 {
     _skyBox.Update(gameTime);
     _fadeableText1.Update(gameTime);
     if (_fadeableText1.AnimationComplete)
     {
         _fadeableText2.Update(gameTime);
         if (_fadeableText2.AnimationComplete)
         {
             _fadeableText3.Update(gameTime);
             if (_fadeableText3.AnimationComplete)
             {
                 _blackBlend.Update(gameTime);
                 if (_blackBlend.IsCompleted)
                 {
                     SGL.QueryComponents <SceneManager>().ActiveScene =
                         SGL.QueryComponents <SceneManager>().Get <MenuScene>();
                 }
             }
         }
     }
 }