示例#1
0
        private void SwitchState(GameStateType stateType)
        {
            switch (stateType)
            {
            case GameStateType.MainMenu:
                ActiveState = MainMenu.GetInstance();
                break;

            case GameStateType.NewGame:
                currentLevel = NewGame();
                ActiveState  = currentLevel;
                Player.GetInstance().ResetPlayer();
                break;

            case GameStateType.GameRunning:
                ActiveState = currentLevel;
                break;

            case GameStateType.GamePaused:
                ActiveState = GamePaused.GetInstance();
                break;

            case GameStateType.NextLevel:
                currentLevel = NextLevel();
                ActiveState  = currentLevel;
                break;
            }
        }
示例#2
0
        public void SwitchState(GameStateType stateType)
        {
            switch (stateType)
            {
            case GameStateType.GameRunning:
                ActiveState = GameRunning.GetInstance();
                break;

            case GameStateType.GamePaused:
                ActiveState = GamePaused.GetInstance();
                break;

            case GameStateType.MainMenu:
                ActiveState = MainMenu.GetInstance();
                break;

            case GameStateType.ChooseLevel:
                ActiveState = ChooseLevel.GetInstance();
                break;
            }
        }