public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); prevKbs = currentKbs; currentKbs = Keyboard.GetState(); foreach (Keys k in keysToCheck) { if (checkKey(k)) { addKeyToString(k); } } contButton.Update(mouse.rectangle); if (contButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { if (!string.IsNullOrEmpty(name) && !name.Contains("_")) { buttonconfirm.Play(); ScreenManager.RemoveScreen(this); ScreenManager.AddScreen(new GamePlayScreen(this.gamediff, name), null); } else { buttonerror.Play(); } } mouse.Update(); }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); mouse.Update(); exitButton.Update(mouse.rectangle); if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { exitButton.sound.Play(); ScreenManager.RemoveScreen(this); ScreenManager.AddScreen(new MainMenuScreen(), null); } }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); mouse.Update(); easyButton.Update(mouse.rectangle); if (easyButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { ExitScreen(); } hardButton.Update(mouse.rectangle); if (hardButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { ExitScreen(); System.Threading.Thread.Sleep(100); ScreenManager.AddScreen(new MainMenuScreen(), null); } }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); mouse.Update(); exitButton.Update(mouse.rectangle); if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { exitButton.sound.Play(); ExitScreen(); if (player.level < 3) { ScreenManager.AddScreen(new GamePlayScreen(GameDifficulty.EASY_MODE, player.name, player.score, player._lives, player._health, player.level + 1), null); } else { ScreenManager.AddScreen(new GameOverScreen(player, GameOverScreen.gameOverType.COMPLETE), null); } } }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); mouse.Update(); easyButton.Update(mouse.rectangle); if (easyButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { easyButton.sound.Play(); ScreenManager.RemoveScreen(this); ScreenManager.AddScreen(new NameEntryScreen(GameDifficulty.EASY_MODE), null); } hardButton.Update(mouse.rectangle); if (hardButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { hardButton.sound.Play(); ScreenManager.RemoveScreen(this); ScreenManager.AddScreen(new NameEntryScreen(GameDifficulty.HARD_MODE), null); } }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); mouse.Update(); highscoresButton.Update(mouse.rectangle); if (highscoresButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { click.Play(); ExitScreen(); ScreenManager.AddScreen(new HighScoreScreen(), null); } newGameButton.Update(mouse.rectangle); if (newGameButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { click.Play(); ExitScreen(); ScreenManager.AddScreen(new ModeSelectScreen(), null); } exitButton.Update(mouse.rectangle); if (exitButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { click.Play(); ExitScreen(); ScreenManager.Game.Exit(); } helpButton.Update(mouse.rectangle); if (helpButton.Intersects(mouse.rectangle) && mouse.newLeftClick) { click.Play(); ExitScreen(); ScreenManager.AddScreen(new InstructionsScreen(), null); } }