Example #1
0
 public ConsoleManager(int gameWidth, int gameHeight)
 {
     mainMenu  = new MainMenuConsole(gameWidth, gameHeight, this);
     gameState = GameState.MAIN_MENU;
     Children.Add(mainMenu);
     SadConsole.Global.CurrentScreen = mainMenu;
 }
        private void CheckInput()
        {
            if (SadConsole.Global.KeyboardState.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Down))
            {
                if (selectChoice < 1)
                {
                    selectChoice++;
                }
                else
                {
                    selectChoice = 0;
                }
            }

            if (SadConsole.Global.KeyboardState.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Up))
            {
                if (selectChoice > 0)
                {
                    selectChoice--;
                }
                else
                {
                    selectChoice = 1;
                }
            }

            if (SadConsole.Global.KeyboardState.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Space) || SadConsole.Global.KeyboardState.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.Enter))
            {
                if (selectChoice == 0)
                {
                    SadConsole.Global.CurrentScreen = game;
                }
                if (selectChoice == 1)
                {
                    conMan          = new ConsoleManager(TimelessPeach.width, TimelessPeach.height);
                    mainMenuConsole = new MainMenuConsole(TimelessPeach.width, TimelessPeach.height, conMan);
                    SadConsole.Global.CurrentScreen = mainMenuConsole;
                    conMan.ChangeState(GameState.MAIN_MENU);
                }
            }
        }