
also habe ich die tshapes deklariert (aktivshape ist ein array[1..4] of Tshape) und in BLBrick.create werde sie dann erstellt. allerdings erscheinen sie nicht in der tform

Code: Alles auswählen
constructor BLBrick.create;
var i,f: integer;
begin
for i := 1 to 4 do
begin
activebrick[i]:=Tshape.create(Form1);
with activebrick[i] do
begin
parent:= Form1;
width:=20;
height:=20;
shape:= stRectangle;
tag:=i;
visible:=true;
if i = 1 then f:= random(4);
case f of
0: brush.color:= clred;
1: brush.color:= clblue;
2: brush.color:= cllime;
3: brush.color:= clyellow;
4: brush.color:= clFuchsia;
end;
case i of
1: begin
left:=200;
top := 60;
end;
2: begin
left:=200;
top := 80;
end;
3: begin
left:=200;
top := 100;
end;
4: begin
left:=220;
top := 800;
end;
end;
end;
end;
end;