Hi,
one more please:
Like I asked some questions ago:
The Blocktester is a bit hard to understand, did I make it right?
Right now my people still run 'through' the obastacles, don't know if it is a pathfinding or a movement bug.
Here my blocktester:
Code:
function TForm1.blocktester(X, Y, Fx, Fy: integer): integer;
begin
result:= -1; // if it isnt anything else - it is wall
if level[x,y]=255 then result:=round(((ABS(FX-X) + ABS(FY - Y)) * 3)/3)
else if level[x,y]=0 then result:= ((ABS(FX-X) + ABS(FY - Y)) * 3);
end;
0 is no obstacle, 255 is a road, this is no obstacle but a way to prefer.
Is the result correct?
Thanks again,
Firle
Bookmarks