卷
卷起千堆雪tyn
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure SprayPoints(Dpoint :TPoint; Radians :Integer); //设定喷枪的中心点和喷洒半径
var
i,a,b,temp :Integer;
begin
Randomize;
for i := 0 to Radians do
begin
temp := Random(100);
a := Random(Round(Radians*0.65));
if (temp < 50) then a :=0 - a;
temp := Random(100);
b := Random(Round(Radians*0.65));
if (temp < 50) then b := 0 - b;
if ( a*a + b*b < Sqr(Round(Radians*0.65))) then
Form1.Canvas.Pixels[DPoint.X+a,DPoint.Y+b] :=clBlue;
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
SprayPoints(Point(x,y),100);
end;
var
i,a,b,temp :Integer;
begin
Randomize;
for i := 0 to Radians do
begin
temp := Random(100);
a := Random(Round(Radians*0.65));
if (temp < 50) then a :=0 - a;
temp := Random(100);
b := Random(Round(Radians*0.65));
if (temp < 50) then b := 0 - b;
if ( a*a + b*b < Sqr(Round(Radians*0.65))) then
Form1.Canvas.Pixels[DPoint.X+a,DPoint.Y+b] :=clBlue;
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
SprayPoints(Point(x,y),100);
end;