Even an analog joystick should work nicely (touch wood), as it should allow the cross-hairs to move at pretty much any speed up to the maximum speed :)
Instead of relying on SDL joystick events, I am now checking the joystick axii in the render routine like so:
Function GetJoyAxisValue(Const AJoystick : PSDL_Joystick;If FHasJoystick Then
Const AAxis,AThreshold : Integer) : Single;
Begin
Result := SDL_JoystickGetAxis(AJoystick,AAxis);
If Result < AThreshold Then
Result := 0
Else
Result := Result / 32768;
End;
{..}
Begin
FCrossHairs.x := FCrossHairs.x + cMoveSpeed * GetJoyAxisValue(TGame(FOwner).JoyStick,cJoyAxis_X,cThreshold) * ATimeSlice;
FCrossHairs.y := FCrossHairs.y - cMoveSpeed * GetJoyAxisValue(TGame(FOwner).JoyStick,cJoyAxis_Y,cThreshold) * ATimeSlice;
End
Get it here while it's still hot ;-)
http://www.paulsbitsandbytes.webatu.com/dod/dod_download.php
cheers,
Paul
No comments:
Post a Comment