示例#1
0
        protected override void Update(GameTime gameTime)
        {
            if (!m_gameLoaded)
            {
                m_gameLoaded = true;
                if (LevelEV.DELETE_SAVEFILE)
                {
                    SaveManager.ClearAllFileTypes(true);
                    SaveManager.ClearAllFileTypes(false);
                }
                if (LevelEV.LOAD_SPLASH_SCREEN)
                {
                    if (LevelEV.RUN_DEMO_VERSION)
                    {
                        ScreenManager.DisplayScreen(28, true);
                    }
                    else
                    {
                        ScreenManager.DisplayScreen(1, true);
                    }
                }
                else if (!LevelEV.LOAD_TITLE_SCREEN)
                {
                    if (LevelEV.RUN_TESTROOM)
                    {
                        ScreenManager.DisplayScreen(5, true);
                    }
                    else if (LevelEV.RUN_TUTORIAL)
                    {
                        ScreenManager.DisplayScreen(23, true);
                    }
                    else
                    {
                        ScreenManager.DisplayScreen(15, true);
                    }
                }
                else
                {
                    ScreenManager.DisplayScreen(3, true);
                }
            }
            TotalGameTime      = (float)gameTime.TotalGameTime.TotalSeconds;
            TotalGameTimeHours = (float)gameTime.TotalGameTime.TotalHours;
            var gameTime2 = gameTime;

            if (gameTime.ElapsedGameTime.TotalSeconds > m_frameLimit)
            {
                if (!m_frameLimitSwap)
                {
                    m_frameLimitSwap = true;
                    gameTime2        = m_forcedGameTime1;
                }
                else
                {
                    m_frameLimitSwap = false;
                    gameTime2        = m_forcedGameTime2;
                }
            }
            SoundManager.Update(gameTime2);
            if (IsActive || (!IsActive && LevelEV.ENABLE_OFFSCREEN_CONTROL))
            {
                InputManager.Update(gameTime2);
            }
            Tween.Update(gameTime2);
            ScreenManager.Update(gameTime2);
            SoundManager.Update3DSounds();
            base.Update(gameTime);
        }