Amazing graphics!
Here another update move with joystick (D-Pad and Left Stick,... at least with an X-Box 360 joy works fine, the D-Pad works perfectly, the Left Stick requires that you move the stick to the extreme, I must set another range that the min and max...).
uses
...
{$IFDEF WINDOWS},
mmsystem{$ENDIF};
...
var
// controls
L1, R1, U1, D1, L2, R2, U2, D2: word;
...
procedure TForm1.FormCreate(Sender: TObject);
begin
L1 := VK_LEFT;
R1 := VK_RIGHT;
U1 := VK_UP;
D1 := VK_DOWN;
L2 := VK_A;
R2 := VK_D;
U2 := VK_W;
D2 := VK_S;
...
procedure TForm1.Timer1Timer(Sender: TObject);
var
...
{$IFDEF WINDOWS}
myJoy: TJoyInfoEx;
myJoyCaps: TJoyCaps;
ErrorResultC, ErrorResultP: MMRESULT;
{$ENDIF}
begin
{$IFDEF WINDOWS}
ErrorResultC := joyGetDevCaps(joystickid1, @myJoyCaps, sizeof(myJoyCaps));
ErrorResultP := joyGetPosEx(joystickid1, @MyJoy);
if (ErrorResultC = JOYERR_NOERROR) and (ErrorResultP = JOYERR_NOERROR) then
begin
if (myJoy.dwPOV = JOY_POVFORWARD) or (myJoy.wYpos = myJoyCaps.wYmin) then
FormKeyDown(nil, U1, [])
else if (myJoy.dwPOV = JOY_POVBACKWARD) or (myJoy.wYpos = myJoyCaps.wYmax) then
FormKeyDown(nil, D1, [])
else if (myJoy.dwPOV = JOY_POVLEFT) or (myJoy.wXpos = myJoyCaps.wXmin) then
FormKeyDown(nil, L1, [])
else if (myJoy.dwPOV = JOY_POVRIGHT) or (myJoy.wXpos = myJoyCaps.wXmax) then
FormKeyDown(nil, R1, []);
end;
{$ENDIF}