I am using a very basic formula to calculate what angle my sprite (spaceship for example) should be facing based on the Xbox controller thumbstick i.e. you use the thumbstick to rotate the ship.
In my main update method:
shuttleAngle = (float) Math.Atan2(newGamePadState.ThumbSticks.Right.X, newGamePadState.ThumbSticks.Right.Y);
In my main draw method:
spriteBatch.Draw(shuttle, shuttleCoords, sourceRectangle, Color.White, shuttleAngle, origin, 1.0f, SpriteEffects.None, 1);
As you can see it's quite simple, I take the current radians from the thumbstick and store it in a float shuttleAngle
and then use this as the rotation angle (in radians) argument for drawing the shuttle.
For some reason when I rotate the sprint it feels sticky at 0, 90, 180 and 270 degrees angles. It wants to settle at those angles. It's not giving me a smooth and natural rotation like I would feel in a game that uses a similar mechanic. PS: My Xbox controller is fine!
shuttleAngle
to see if that sticks at those angles \$\endgroup\$ – Joe Shanahan Sep 13 '12 at 14:19