public override void Update(GameTime gameTime) { menuComponent.Update(gameTime); if (XInput.CheckKeyReleased(Keys.Space) || XInput.CheckKeyReleased(Keys.Enter) || (menuComponent.MouseOver && XInput.CheckMouseReleased(MouseButtons.Left))) { if (menuComponent.SelectedIndex == 0) { difficulty = "EASY"; manager.ChangeState((PlayState)GameRef.StartPlayState); } else if (menuComponent.SelectedIndex == 1) { difficulty = "MEDIUM"; manager.ChangeState((PlayState)GameRef.StartPlayState); } else if (menuComponent.SelectedIndex == 2) { difficulty = "HARD"; manager.ChangeState((PlayState)GameRef.StartPlayState); } else if (menuComponent.SelectedIndex == 3) { manager.ChangeState((MainMenuState)GameRef.StartMenuState); } } base.Update(gameTime); }
public override void Update(GameTime gameTime) { menuComponent.Update(gameTime); if (XInput.CheckKeyReleased(Keys.Space) || XInput.CheckKeyReleased(Keys.Enter) || (menuComponent.MouseOver && XInput.CheckMouseReleased(MouseButtons.Left))) { if (menuComponent.SelectedIndex == 0) { if (isSoundEnabled) { isSoundEnabled = false; } else if (!isSoundEnabled) { isSoundEnabled = true; } } else if (menuComponent.SelectedIndex == 1) { manager.ChangeState((MainMenuState)GameRef.StartMenuState); } } base.Update(gameTime); }
public override void Update(GameTime gameTime) { elapsed += gameTime.ElapsedGameTime; if (XInput.CheckKeyReleased(Keys.Space) || XInput.CheckKeyReleased(Keys.Enter) || XInput.CheckMouseReleased(MouseButtons.Left)) { manager.ChangeState((MainMenuState)GameRef.StartMenuState); } base.Update(gameTime); }
public override void Update(GameTime gameTime) { menuComponent.Update(gameTime); if (XInput.CheckKeyReleased(Keys.Space) || XInput.CheckKeyReleased(Keys.Enter) || (menuComponent.MouseOver && XInput.CheckMouseReleased(MouseButtons.Left))) { if (menuComponent.SelectedIndex == 0) { manager.ChangeState((ChooseMapState)GameRef.StartChooseMapState); } else if (menuComponent.SelectedIndex == 1) { manager.ChangeState((SettingsState)GameRef.StartSettingsState); } else if (menuComponent.SelectedIndex == 2) { Game.Exit(); } } base.Update(gameTime); }
public void KeyBoardInput() { //BUILD MODE if (!gameManager.towerManager.buildMode) { if (XInput.CheckKeyReleased(Keys.L)) { gameManager.towerManager.buildMode = true; gameManager.towerManager.towerType = "LASER"; } else if (XInput.CheckKeyReleased(Keys.B)) { gameManager.towerManager.buildMode = true; gameManager.towerManager.towerType = "BURST"; } else if (XInput.CheckKeyReleased(Keys.R)) { gameManager.towerManager.buildMode = true; gameManager.towerManager.towerType = "RAIL"; } } else { if (gameManager.towerManager.towerType == "LASER") { if (XInput.CheckKeyReleased(Keys.L)) { gameManager.towerManager.buildMode = false; gameManager.towerManager.towerType = null; } else if (XInput.CheckKeyReleased(Keys.B)) { gameManager.towerManager.towerType = "BURST"; } else if (XInput.CheckKeyReleased(Keys.R)) { gameManager.towerManager.towerType = "RAIL"; } } else if (gameManager.towerManager.towerType == "BURST") { if (XInput.CheckKeyReleased(Keys.B)) { gameManager.towerManager.buildMode = false; gameManager.towerManager.towerType = null; } else if (XInput.CheckKeyReleased(Keys.L)) { gameManager.towerManager.towerType = "LASER"; } else if (XInput.CheckKeyReleased(Keys.R)) { gameManager.towerManager.towerType = "RAIL"; } } else if (gameManager.towerManager.towerType == "RAIL") { if (XInput.CheckKeyReleased(Keys.R)) { gameManager.towerManager.buildMode = false; gameManager.towerManager.towerType = null; } else if (XInput.CheckKeyReleased(Keys.L)) { gameManager.towerManager.towerType = "LASER"; } else if (XInput.CheckKeyReleased(Keys.B)) { gameManager.towerManager.towerType = "BURST"; } } } //TARGET MODE if (XInput.CheckKeyReleased(Keys.F)) { gameManager.targetPriority = "FIRST"; targetMode = 0; } else if (XInput.CheckKeyReleased(Keys.A)) { gameManager.targetPriority = "LAST"; targetMode = 1; } else if (XInput.CheckKeyReleased(Keys.S)) { gameManager.targetPriority = "STRONG"; targetMode = 2; } else if (XInput.CheckKeyReleased(Keys.N)) { gameManager.targetPriority = "NEAR"; targetMode = 3; } //SPEED MODE if (XInput.CheckKeyReleased(Keys.Space)) { if (speedMode == 0) { speedMode = 1; } else { speedMode = 0; } } //CHEAT CODES if (XInput.CheckKeyHeld(Keys.LeftShift) && XInput.CheckKeyHeld(Keys.LeftControl) && XInput.CheckKeyHeld(Keys.H)) { gameManager.gameHealth = 100000000; } if (XInput.CheckKeyHeld(Keys.LeftShift) && XInput.CheckKeyHeld(Keys.LeftControl) && XInput.CheckKeyHeld(Keys.M)) { gameManager.gameMoney = 100000000; } if (XInput.CheckKeyHeld(Keys.LeftShift) && XInput.CheckKeyHeld(Keys.LeftControl) && XInput.CheckKeyHeld(Keys.S)) { speedMode = 10; } }