Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as text by BITNIK ( 17 years ago )
procedure MovingObjects(img, x, y: int);
var
X1: integer;
GO: boolean;
begin
setlength(xobject, 2);
XOBJX:=img;
if (gettickcount>=X1) and (xobject[XOBJX]^.X <> X+1) and (xobject[XOBJX]^.Y <> Y+1) and (xobject[XOBJX]^.X <> X-1) and (xobject[XOBJX]^.Y <> Y-1)and (xobject[XOBJX]^.X <> X) and (xobject[XOBJX]^.Y <> Y)then
begin
GO:=TRUE;
end;
if (xobject[XOBJX]^.X > X) and (xobject[XOBJX]^.Y > Y) and GO then
begin
xobject[XOBJX]^.X := xobject[XOBJX]^.X - 1/Y-1;
xobject[XOBJX]^.Y := xobject[XOBJX]^.Y - 1/X-1;
X1:=GetTickCount+100;
GO:=false;
end
else if (xobject[XOBJX]^.X < X) and (xobject[XOBJX]^.Y < Y) and GO then
begin
xobject[XOBJX]^.X := xobject[XOBJX]^.X + 1/Y+1;
xobject[XOBJX]^.Y := xobject[XOBJX]^.Y + 1/X+1;
X1:=GetTickCount+100;
GO:=false;
end
else if (xobject[XOBJX]^.X <= X) and (xobject[XOBJX]^.Y >= Y) and GO then
begin
xobject[XOBJX]^.X := xobject[XOBJX]^.X + 1/Y+1;
xobject[XOBJX]^.Y := xobject[XOBJX]^.Y - 1/X-1;
X1:=GetTickCount+100;
GO:=false;
end
else if (xobject[XOBJX]^.X >= X) and (xobject[XOBJX]^.Y <= Y) and GO then
begin
xobject[XOBJX]^.X := xobject[XOBJX]^.X - 1/Y-1;
xobject[XOBJX]^.Y := xobject[XOBJX]^.Y + 1/X+1;
X1:=GetTickCount+100;
GO:=false;
end;
end;
Revise this Paste
Children: 8268