I tried this code and I think that it worked.
If JoyType(0) Then stick=0
If JoyType(1) Then stick=1
If JoyType(2) Then stick=2
If JoyType(3) Then stick=3
While Not KeyDown(1)
If JoyHit(13,stick) Then gear=gear-1:If gear<-1 Then gear=-1
If JoyHit(14,stick) Then gear=gear+1:If gear>1 Then gear=1
If JoyHit(3,stick) Then gear=gear-1:If gear<-1 Then gear=-1
If JoyHit(4,stick) Then gear=gear+1:If gear>1 Then gear=1
If gear=-1 Then gearstring="Reverse"
If gear=0 Then gearstring="Neutral"
If gear=1 Then gearstring="Drive"
EntityParent camera02,camera01
If JoyY(stick) < -0.05
If gear=1
speed=speed+0.005
If speed>2 Then speed=2
MoveEntity camera01,0,0,speed
End If
If gear=-1
speed=speed-0.005
If speed<-0.5 Then speed=-0.5
MoveEntity camera01,0,0,speed
EndIf
End If
If JoyY(stick) > 0.05
speed=speed-0.01
If speed<0 Then speed=0
speed=speed*0.99
MoveEntity camera01,0,0,speed
End If
If JoyY(stick) > -0.05 And JoyY(stick) < 0.05
speed=speed*0.99
MoveEntity camera01,0,0,speed
End If
If JoyX(stick) < -0.05 And speed>0
steer=-JoyX(stick)
If steer>1 Then steer=1
TurnEntity camera01,0,steer,0
End If
If JoyX(stick) > 0.05 And speed>0
steer=-JoyX(stick)
If steer<-1 Then steer=-1
TurnEntity camera01,0,steer,0
End If
If JoyX(stick) < -0.05 And speed<0
steer=JoyX(stick)
If steer<-1 Then steer=-1
TurnEntity camera01,0,steer,0
End If
If JoyX(stick) > 0.05 And speed<0
steer=JoyX(stick)
If steer>1 Then steer=1
TurnEntity camera01,0,steer,0
End If
If JoyX(stick) > -0.05 And JoyX(stick) < 0.05 Then steer=0
|