private
blockwait, bottomcheck, movement, x, y: integer;
start, filled: boolean;
location: array[0..9, 0..19] of integer;
public
end;
var
Form1: TForm1;
filled: array[0..9, 0..19] of boolean;
implementation
-------------------------------------------
procedure tform1.createblock();
var
a,b:integer;
img : Timage;
begin
x:=4;
y:=0;
img:= timage.create(application);
img.top:=y*50;
img.left:=x*50;
img.visible:=true;
img.picture:=fallingblock.picture;
img.stretch:=true;
img.width:=50;
img.height:=50;
img.enabled:=true;
img.transparent:=true;
img.Parent:=fallingblock.parent;
fallingblock:=img;
img.top:=a;
img.left:=b;
//i tried converting the coordinates from x, to img.left,to b, so that filled would hopefully stay in one place instead
//of moving around the field attached to a falling block.
filled[a,b]:=true;
end;
------------------------------
//if a block hits the bottom procedure createblock is called, I still have to write code for the falling block hitting a filled:=true but i'm currently stuck.
procedure TForm1.blockfallingTimer(Sender: TObject);
begin
y:=y+1;
fallingblock.top := 50 * y;
if y>=19 then
begin
y:=0;
createblock();
end;
end;