mixster
2008-02-13 14:12:13
After seeing a game (linerider) I quickly got addicted. The only problem I came across with it though was that it was very hard to make circles - thus DrawCircle was born. I do plan on adding a start and end angle, but since I'm using pythagorus instead of sine etc. it makes it hard since I'm lazy and it would involve some hard work ;).
Now, to present it:
You just have to give it a place to start (cx and cy) then how big you want the circle to be (radius). A good example is to use it in paint - do be warned though that it goes slower as the circle gets bigger.
Have fun
Now, to present it:
procedure DrawCircle(cx,cy,r: Integer);
var
x,y,y2,i: Integer;
first: boolean;
begin
first:= true;
for i:= 0 to 1 do
begin
for y:= -r to r do
begin
x:= Round(Sqrt(Sqr(r)-(Sqr(y))));
if(first) then
begin
first:= false;
Sleep(10);
HoldMouse(cx+x,cy+y,True)
Sleep(10);
end;
if(i=1) then
begin
x:=-x;
y2:= -y
end
else
y2:= y;
MoveMouse(cx+x,cy+y2);
Sleep(1);
end;
end;
ReleaseMouse(cx+x,cy+y2,True);
end;You just have to give it a place to start (cx and cy) then how big you want the circle to be (radius). A good example is to use it in paint - do be warned though that it goes slower as the circle gets bigger.
Have fun