/// <summary> /// This handles the logic behind checking which controller is used and setting it to the used controller. /// </summary> /// <param name="pack">see doPacket</param> public override void doThis(doPacket pack) { base.doThis(pack); GamePadState PL1 = GamePad.GetState(PlayerIndex.One); GamePadState PL2 = GamePad.GetState(PlayerIndex.Two); GamePadState PL3 = GamePad.GetState(PlayerIndex.Three); GamePadState PL4 = GamePad.GetState(PlayerIndex.Four); if (PL1.IsButtonDown(Buttons.Start) || PL1.IsButtonDown(Buttons.A)) { state.setController(new Controller(PlayerIndex.One)); } else if (PL2.IsButtonDown(Buttons.Start) || PL2.IsButtonDown(Buttons.A)) { state.setController(new Controller(PlayerIndex.Two)); } else if (PL3.IsButtonDown(Buttons.Start) || PL3.IsButtonDown(Buttons.A)) { state.setController(new Controller(PlayerIndex.Three)); } else if (PL4.IsButtonDown(Buttons.Start) || PL4.IsButtonDown(Buttons.A)) { state.setController(new Controller(PlayerIndex.Four)); } else {} }
public override void nextState(doPacket pack) { pack.state.loadState(new PressStartState()); }