Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            if (this.isAppStarting)
            {
                MainMenu.Activate();
                this.isAppStarting = false;
            }
            else
            {
                SteamIntegration.Update();
            }
            if (ScreenManager.GameClosing)
            {
                SteamAPI.Shutdown();
                base.Exit();
            }
            if (base.IsActive && !SteamIntegration.instance.IsPublishing)
            {
                MainMenu.Update();
                LevelSaver.Update();

                if (popupBox == null)
                {
                    InGame.Update();
                    Editor.Update();
                }
                else if (popupBox.IsFinished)
                {
                    popupBox = null;
                }
                InputManager.CheckInput();
            }
            else if (ScreenManager.Ingame)
            {
                PauseMenu.Pause();
            }
            if (LevelLoader.LevelComplete)
            {
                if (!ScreenManager.Custom)
                {
                    SaveFile.CompleteLevel();
                }
                if (Level.Current == Level.maxLevels)
                {
                    if (ScreenManager.Custom)
                    {
                        Level.Current = 0;
                        LevelLoader.NextLevel();
                    }
                    else
                    {
                        SteamIntegration.Achievements.GameComplete();
                        LevelLoader.LevelComplete = false;
                        ScreenManager.GameCompleteOn();
                    }
                }
                else
                {
                    LevelLoader.NextLevel();
                }
            }

            if (DebugMode)
            {
                debug.Update(gameTime);
            }

            TimeSinceLastUpdate = ((float)base.TargetElapsedTime.TotalMilliseconds) / 1000f;
            base.Update(gameTime);
        }