n3ss3s
2007-08-02 15:12:37
Yea, well I was bored and I made a FindColorCircle, but the difference is that it searches from out to in, and very useful for walking if we wouldnt have radial walk, because it would take as long steps as possible.
EDIT: One thing, could someone tell me how to add radial search for it? I mean to search for the color like RadialWalk does?
EDIT: One thing, could someone tell me how to add radial search for it? I mean to search for the color like RadialWalk does?
function FindColorCircle2(var Cx2, Cy2: Integer; Color, MidX, MidY, StartDist,
MinDist, Tol: Integer): Boolean;
var
Dx, Dy, Dist: Integer; // Its ready here since global x and y will be removed
begin
for Dist := StartDist downto MinDist do
begin
if(FindColorCircleTolerance(Dx, Dy, Color, MidX, MidY, Dist, Tol))then
begin
if(Distance(Dx, Dy, MidX, MidY) = Distance(MidX, MidY, MidX + Dist,
MidY)) then
begin
Cx2 := Dx;
Cy2 := Dy;
Result := True;
end else
begin
Status('Distance is now ' + IntToStr(Dist - 1));
end;
end;
end;
end;