I found that DelphiX had its own Z-Value... i only set that equal to Y, and it worked... as for the movement stuff, i think i'll make the server send the playerpos to all clients when executing the movement timer... i dont know if this'll fix it, but i think so....
problem is, i dont know how many players i can have before it starts lagging...
my code for the movement timers ontimer is now:
Code:
procedure TfMain.MovementTimer2Timer(Sender: TObject);
var
i: Integer;
begin
for i:=0 to Length(Players)-1 do
begin
if Players[i].Online then
begin
if Players[i].dir = 0 then
Players[i].x:= Players[i].x+Players[i].speed
else if Players[i].dir = 2 then
Players[i].x:= Players[i].x-Players[i].speed
else if Players[i].dir = 1 then
Players[i].y:= Players[i].y-Players[i].speed
else if Players[i].dir =3 then
Players[i].y:= Players[i].y+Players[i].speed
end;
end;
for i:=0 to Length(Players)-1 do
begin
if Players[i].Online then
begin
SendPlayerPos(i);
end;
end;
end;
The reason i dont have the SendPlayerPos in the first loop is, obviously, that i need to move all players before sending it...
Bookmarks