jobel wrote:the thumbstick has a range of values.. for example in my top down space game, the player's ship can spin left or right. So I take the value from the thumbstick to dictate how fast to spin:
IF Gamepad(0) Left analog X axis < 0 (meaning the player is pushing the stick to the left (since 0 to -100 are the values to the left)
THEN Rotate PlayerSprite (abs(Gamepad.Axis(0,0)) * ThrusterAmount) * dt DEGREES CounterClockwise
So, I take the absolute value to invert the negative number... so now my rotation is varying on how far the player pushes the stick to the left.. they can be really delicate and spin really slow or jam the stick to the way left and spin at max speed...
Users browsing this forum: No registered users and 1 guest