2019-03-26 00:03:07 +03:00
|
|
|
|
uses WPFObjects;
|
|
|
|
|
|
|
|
|
|
|
|
function GenRandomWPF: ObjectWPF;
|
|
|
|
|
|
begin
|
|
|
|
|
|
var x := Random(Window.Width);
|
|
|
|
|
|
var y := Random(Window.Height);
|
|
|
|
|
|
case Random(3) of
|
|
|
|
|
|
0: Result := new CircleWPF(x,y,Random(15,20),RandomColor);
|
|
|
|
|
|
1: Result := new EllipseWPF(x,y,Random(15,60),Random(15,60),RandomColor);
|
|
|
|
|
|
2: Result := new RegularPolygonWPF(x,y,Random(15,30),Random(3,8),RandomColor);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
loop 100 do
|
|
|
|
|
|
GenRandomWPF;
|
|
|
|
|
|
|
|
|
|
|
|
Sleep(1000);
|
|
|
|
|
|
foreach var o in Objects.Seq do
|
|
|
|
|
|
match o with
|
|
|
|
|
|
CircleWPF(c): c.Radius += 10;
|
2020-11-16 20:04:43 +03:00
|
|
|
|
EllipseWPF(e): e.AnimMoveBy(Random(-50,50),Random(-50,50),1);
|
2019-08-05 00:23:28 +03:00
|
|
|
|
RegularPolygonWPF(r) when r.Count<6: r.SetBorder;
|
2019-03-26 00:03:07 +03:00
|
|
|
|
end
|
|
|
|
|
|
end.
|