Esempio n. 1
0
        public gameManager(Game Game)
        {
            game = Game;

            oldState = Keyboard.GetState();

            paused = false;

            menu         = new mainmenu(game, mainmenu.context.game);
            menu.manager = this;
            menu.hide();
        }
Esempio n. 2
0
        public override void Update()
        {
            newState = Keyboard.GetState();

            if (KeyboardStroke.KeyDown(oldState, newState, Keys.Escape))
            {
                if (paused)
                {
                    paused = false;
                }
                else
                {
                    paused = true;
                }
            }


            oldState = newState;

            if (paused)
            {
                menu.show();
            }
            else
            {
                menu.hide();
            }
            menu.Update();

            if (!game.IsActive)
            {
                paused = true;
            }

            base.Update();
        }