Dim Throttle As Long
Dim Steering As Long
Dim Flip As Boolean
Dim LastFlipState As Boolean
'false = up true = down
Throttle = StickX
Steering = StickY
If chkReverseSteering Then Steering = Steering * -1
If chkRevThrottle Then Throttle = Throttle * -1
If chkSROT And Throttle < 0 Then Steering = Steering - 1
Dim Diflection As Double
Dim Slowdown As Double
If JoystickState.buttons(11) = 128 Then
Shape1.FillColor = 255
Steering = Steering / 4
Else
Shape1.FillColor = 0
End If
Diflection = (Throttle / 32767) * 2
Slowdown = Diflection * Steering
If chkFlip Then
Steering = Steering * -1
Throttle = Throttle * -1
End If
'both = full forward
'StickX = StickX
'StickY = StickX
Select Case Steering
Case Is < 0 'left
StickX = Throttle
StickY = Throttle + Slowdown
Case Is > 0 ' right
StickY = Throttle
StickX = Throttle - Slowdown
Case Is = 0 ' straight
StickX = Throttle
StickY = Throttle
End Select
End If
There are no comments on this page. [Add comment]