public void tick(float timedelta) { /* * GamePadState inputstate = GamePad.GetState(initiated); * if (inputstate.IsButtonDown(Buttons.RightShoulder)) * { * owner.pop(); * } */ if (Controller.RecentlyPressed(PlayerIndex.One, Buttons.Back, 0.5f)) { owner.pop(); } }
public void tick(float timedelta) { if (Controller.RecentlyPressed(PlayerIndex.One, Buttons.Start, 0.5f)) { //states.push(new GameState(states, levelProtos[0])); foreach (PlayerIndex controller in controllers) { Console.WriteLine("Controller: {0}", controller); addPlayer(controller); } states.push(GameState.Create(states, levelProtos[selectedLevel], players)); players.Clear(); } if (Controller.RecentlyPressed(PlayerIndex.One, Buttons.Back, 0.5f)) { states.pop(); } //if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.Back)) // states.pop(); }