public void update()
{
old = current;
current = GamePad.GetState(index);
leftAnalogX = current.ThumbSticks.Left.X;
leftAnalogY = current.ThumbSticks.Left.Y;
rightAnalogX = current.ThumbSticks.Right.X;
rightAnalogY = current.ThumbSticks.Right.Y;
leftTrigger = current.Triggers.Left;
rightTrigger = current.Triggers.Right;
if (vibeDuration > 0)
{
vibeDuration -= FlxG.elapsed;
if (vibeDuration <= 0)
{
leftVibe = rightVibe = 0;
}
GamePad.SetVibration(index, leftVibe, rightVibe);
}
}