Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private void SetTime(SkyBoxTime time)
        {
            switch (time)
            {
            case SkyBoxTime.Morning:
                connector.SendPacket(Skybox.SetTime(9), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("bluecloud_rt.jpg"), GetSkyBox("bluecloud_lf.jpg"),
                                                       GetSkyBox("bluecloud_up.jpg"),
                                                       GetSkyBox("bluecloud_dn.jpg"), GetSkyBox("bluecloud_bk.jpg"),
                                                       GetSkyBox("bluecloud_ft.jpg")),
                                         new Action <JObject>(morningData => { Console.WriteLine("It's daytime!"); }));
                }));
                break;

            case SkyBoxTime.Afternoon:
                connector.SendPacket(Skybox.SetTime(12), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("graycloud_rt.jpg"), GetSkyBox("graycloud_lf.jpg"),
                                                       GetSkyBox("graycloud_up.jpg"),
                                                       GetSkyBox("graycloud_dn.jpg"), GetSkyBox("graycloud_bk.jpg"),
                                                       GetSkyBox("graycloud_ft.jpg")),
                                         new Action <JObject>(afternoonData => { Console.WriteLine("It's the afternoon!"); }));
                }));
                break;

            case SkyBoxTime.Evening:
                connector.SendPacket(Skybox.SetTime(20), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("yellowcloud_rt.jpg"), GetSkyBox("yellowcloud_lf.jpg"),
                                                       GetSkyBox("yellowcloud_up.jpg"),
                                                       GetSkyBox("yellowcloud_dn.jpg"), GetSkyBox("yellowcloud_bk.jpg"),
                                                       GetSkyBox("yellowcloud_ft.jpg")),
                                         new Action <JObject>(eveningData => { Console.WriteLine("It's in the evening!"); }));
                }));
                break;

            case SkyBoxTime.Night:
                connector.SendPacket(Skybox.SetTime(22), new Action <JObject>(data =>
                {
                    connector.SendPacket(Skybox.Update("static",
                                                       GetSkyBox("graycloud_rt.jpg"), GetSkyBox("graycloud_lf.jpg"),
                                                       GetSkyBox("graycloud_up.jpg"),
                                                       GetSkyBox("graycloud_dn.jpg"), GetSkyBox("graycloud_bk.jpg"),
                                                       GetSkyBox("graycloud_ft.jpg")),
                                         new Action <JObject>(nightData => { Console.WriteLine("It's nightTime!"); }));
                }));
                break;
            }
        }
Exemplo n.º 3
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>();
                 }
             }
         }
     }
 }