示例#1
0
        private void CheckKeyboardAndReact()
        {
            if (ctrl.debugToggle())
            {
                if (debugBool)
                {
                    debugBool = false;
                }
                else
                {
                    debugBool = true;
                }
            }

            if (ctrl.resetGame())
            {
                RestartGame(0);
            }

            if (ctrl.levelChange())
            {
                if (level == 1)
                {
                    level = 2;
                    Board.CurrentBoard = board2;
                    bgNum = 0;
                    MusicPlayer.SwitchSong(4, level);
                }
                else
                {
                    level = 1;
                    Board.CurrentBoard = board1;
                    bgNum = 0;
                    MusicPlayer.SwitchSong(4, level);
                }
            }
        }
示例#2
0
        public static void setState(int state, int prevState)
        {
            if (prevState == 1)
            {
                //do nothing
            }
            else
            {
                MusicPlayer.SwitchSong(state, level);
            }

            if (state == 1)
            {
                mCurrentState    = GameState.Title;
                currentGameState = 1;
            }
            else if (state == 2)
            {
                mCurrentState    = GameState.Hall;
                currentGameState = 2;
            }
            else if (state == 3)
            {
                mCurrentState    = GameState.Options;
                currentGameState = 3;
            }
            else if (state == 4)
            {
                mCurrentState    = GameState.Playing;
                currentGameState = 4;
            }
            else if (state == 5)
            {
                mCurrentState    = GameState.Sounds;
                currentGameState = 5;
            }
            else if (state == 6)
            {
                mCurrentState    = GameState.Controls;
                currentGameState = 6;
            }
            else if (state == 7)
            {
                mCurrentState    = GameState.Pause;
                currentGameState = 7;
            }
            else if (state == 8)
            {
                mCurrentState    = GameState.Pong;
                currentGameState = 8;
            }
            else if (state == 9)
            {
                mCurrentState    = GameState.Frogger;
                currentGameState = 9;
            }
            else if (state == 10)
            {
                mCurrentState    = GameState.MiniGames;
                currentGameState = 10;
            }
            else if (state == 11)
            {
                mCurrentState    = GameState.Graphics;
                currentGameState = 11;
            }
            else if (state == 12)
            {
                mCurrentState    = GameState.Show;
                currentGameState = 12;
            }
            else
            {
                mCurrentState    = GameState.Difficulty;
                currentGameState = 13;
            }
        }