public gameManager(Game Game) { game = Game; oldState = Keyboard.GetState(); paused = false; menu = new mainmenu(game, mainmenu.context.game); menu.manager = this; menu.hide(); }
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(); }