コード例 #1
0
ファイル: SpellswordGame.cs プロジェクト: Exmintor/Spellsword
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }
            switch (CurrentState)
            {
            case GameState.World:
                walkingScene.Update(gameTime);
                break;

            case GameState.Paused:
                if (inputHandler.WasButtonPressed(Keys.P))
                {
                    SwitchToWorld();
                }
                break;

            case GameState.Battle:
                battleScene.Update(gameTime);
                break;

            case GameState.MainMenu:
                menuScene.Update(gameTime);
                break;

            case GameState.WinState:
                walkingScene.Update(gameTime);
                if (inputHandler.WasButtonPressed(Keys.R))
                {
                    ResetGame();
                }
                break;
            }
            base.Update(gameTime);
        }