zeOxx / StudentGame

A continuation of the previous repo (https://github.com/zeOxx/Perihelion)
4 stars 1 forks source link

Speed is wrong when going in a diagonal direction #11

Closed zeOxx closed 11 years ago

zeOxx commented 11 years ago

Setting this as high priority, since movement is pretty important

snorrewb commented 11 years ago

In what way? Explain, and I'll look at it.

zeOxx commented 11 years ago

just check the numbers that is spit out in the console? should be 5, but diagonal movement is at about 6.5. in other words, diagonal movement is faster than it should be

snorrewb commented 11 years ago

Oki, I'll have a gander.

snorrewb commented 11 years ago
currentGamePadState = GamePad.GetState(PlayerIndex.One);
Vector2 movementInput = new Vector2(currentGamePadState.ThumbSticks.Left.X,
                                      currentGamePadState.ThumbSticks.Left.Y);
return movementInput;

Returns a Vector2 that usually (when the stick is not directly on the X or Y axis) has a length above or below 1 when it is pressed all the way out. According to MSDN, this is not possible. Fools. Anyway, that's why this is broken, and I'm not smart enough to fix it currently.

Slokken commented 11 years ago

Turned out the deadzone was set to default. Corrected to Circular.