Example #1
0
        public MenuController(StartMenu startMenu, OptionMenu optionMenu, PlayGameMenu PlayGameMenu, ref GameState state, GameEngine engine)
        {
            this.engine = engine;
            engine.ViewPositions.Add(new Tuple <Vector3, Viewport, Entity> (new Vector3(0, 0, 0), engine.GraphicsDevice.Viewport, null));
            this.currentState = state;
            currentState      = GameState.StartMenu;
            SMenu             = startMenu;
            SMenu.AddExitButtonListener(exitButton);
            SMenu.AddOptionsButtonListener(optionsButton);
            SMenu.AddPlayButtonListener(playButton);

            OMenu = optionMenu;
            OMenu.AddBackBtnListener(goBackButton);

            PGMenu = PlayGameMenu;
            PGMenu.AddBackBtnListener(goBackButton);

            engine.SetMouseVisibility(true);
            SMenu.CreateStartMenu();
        }
Example #2
0
 private void goBackButton(EventArgs e)
 {
     engine.ClearEntities();
     currentState = GameState.StartMenu;
     SMenu.CreateStartMenu();
 }