public override void HandleInput(Arcade stateMachine, string input) { if (input == "1") { // Insert a coin int coinsInserted = arcade.GetInt(ParamId.CoinsInserted); coinsInserted++; stateMachine.SetInt(ParamId.CoinsInserted, coinsInserted); } else if (input == "2") { // Stop the state machine stateMachine.Stop(); } }
public override void HandleInput(Arcade stateMachine, string input) { if (input == "1") { // Kill a zombie int zombiesKilled = stateMachine.GetInt(ParamId.ZombiesKilled); zombiesKilled++; stateMachine.SetInt(ParamId.ZombiesKilled, zombiesKilled); } else if (input == "2") { // Lose a heart/life int hearts = stateMachine.GetInt(ParamId.Hearts); hearts--; stateMachine.SetInt(ParamId.Hearts, hearts); } else if (input == "3") { // Open the pause menu. Remember that we configured this as a Push // transition meaning that the game screen retains it state so when // we unpause (aka Pop the pause menu stateMachine.SetBool(ParamId.IsPaused, true); } }