Or another option (to strictly fire once per trigger pull):
Keep two GamePadStates, "current" and "previous".
Every frame, push current to previous, and then update current from GamePad.GetState().
previousState = currentState;
currentState = GamePad.GetState(PlayerIndex.One);
Then only shoot if the trigger is "freshly" pulled, but not if it's being held down.
float currentRightTriggerValue = currentState.Triggers.Right;
float previousRightTriggerValue = previousState.Triggers.Right;
if(currentRightTriggerValue == 1 && previousRightTriggerValue == 0)
I've found that creating an inputManager to do comparison checks like these for any button is IMMENSELY helpful. Then this whole mess can be wrapped in a method call like
Edited by BCullis, 18 February 2013 - 09:54 AM.