public void HandleInput(InputHelper inputHelper) { if (currentGameState != null) { currentGameState.HandleInput(inputHelper); } }
public Practicum1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; random = new Random(); gameStateManager = new GameStateManager(); inputHelper = new InputHelper(); timerManager = new TimerManager(); graphics.PreferredBackBufferHeight = 800; graphics.PreferredBackBufferWidth = 800; graphics.ApplyChanges(); }
public override void HandleInput(InputHelper inputHelper) { if (inputHelper.IsKeyPressed(Keys.D1)) { Practicum1.GameStateManager.SwitchTo("aiPlayerState"); } if (inputHelper.IsKeyPressed(Keys.D2)) { Practicum1.GameStateManager.SwitchTo("twoPlayerState"); } if (inputHelper.IsKeyPressed(Keys.D3)) { Practicum1.GameStateManager.SwitchTo("fourPlayerState"); } if (inputHelper.IsKeyPressed(Keys.D4)) { Practicum1.GameStateManager.SwitchTo("trollState"); } if (inputHelper.IsKeyPressed(Keys.P)) { Practicum1.PowerUpsOn = !Practicum1.PowerUpsOn; if (Practicum1.PowerUpsOn) { powerUpText = "On"; powerUpColor = Color.Green; } else { powerUpText = "Off"; powerUpColor = Color.Red; } powerUpsToggleText2.Text = "" + powerUpText; powerUpsToggleText2.Color = powerUpColor; } if (inputHelper.IsKeyPressed(Keys.F1)) { Practicum1.GameStateManager.SwitchTo("helpState"); } }