Problem with thumbsticks

Nov 15, 2012 at 12:58 PM

Hello, I just discovered nuclex I find very handy. I used to make it compatible with PC controllers for XNA. But I have a problem. Movements in my game (a shooter) are the DPAD and the left analog stick. It works but at times, the X and Y position changes slightly when the stick is not used.

I tried a second joystick and the problem is the same.

Can you help me?

Nov 15, 2012 at 1:35 PM
Edited Nov 15, 2012 at 1:35 PM

Problem solved by me. Simply use code:

if (input.GetGamePad (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.X> = 0.5f | | input.GetGamePad (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.X <=-0.5f)
Position.X input.GetGamePad + = (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.X * SpeedX;

if (input.GetGamePad (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.Y> = 0.5f | | input.GetGamePad (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.Y <=-0.5f)
Position.Y - = input.GetGamePad (ExtendedPlayerIndex.Five). GetState (). ThumbSticks.Left.Y * Speed;