Control of class 'TImage' lazarus / 39-Graphics ---------------------------------------------------------------------- sdfteh · 2016-11-04 20:36 Hello, when I start my project shows up notification   Control of class 'TImage' cant have control of class 'TImage' as a child Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  MainForm: TMainForm;  GameField:array[1..w,6..h] of TImage;  Next:array[1..5,1..5] of TImage; one plase where I have TImage is Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure printfield;  begin chekline; fallbrick; for i:=1 to w do  for j:=1 to h do   begin    GameField[i,j]:=TImage.Create(MainForm);    GameField[i,j].Parent:=MainForm;    GameField[i,j].Height:=a;    GameField[i,j].Width:=a;    GameField[i,j].Top:=j*a+30;    GameField[i,j].left:=i*a+15   end; for i:=1 to w do  for j:=1 to h do   if pole[i,j].sost then    GameField[i,j].Picture.LoadFromFile('.\img\ '+IntToStr(pole[i,j].color)+'.png')   else    GameField[i,j].Picture.LoadFromFile('.\img\0.png'); for i:=1 to 5 do  for j:=1 to 5 do   if brick.amount[i,j] then    GameField[brick.x+i,br ick.y+j].Picture.LoadFromFile('.\img\'+IntToStr(brick.col)+'.png'); fo r i:=1 to 5 do  for j:=1 to 5 do   begin    Next[i,j]:=TImage.Create(MainForm);    Next[i,j].Parent:=MainForm;    Next[i,j].Height:=a;    Next[i,j].Width:=a;    Next[i,j].Top:=j*a+60;    Next[i,j].left:=i*a+283   end; for i:=1 to 5 do  for j:=1 to 5 do   if nextbrick.amount[i,j] then    Next[i,j].Picture.LoadFromFile('.\img\'+IntToStr(brick.col)+'.png')   else    Next[i,j].Picture.LoadFromFile('.\img\0.png');end; Thanks ---------------------------------------------------------------------- lainz · 2016-11-04 21:00 Your code has missing variables that we can't assume. If you don't give us a project that can be compiled is not possible to help you. ---------------------------------------------------------------------- sdfteh · 2016-11-04 21:28 Ok but its too big Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,  StdCtrls; const w=10; h=25; a=25; normal_tick=600; fast_tick=100; type   { TMainForm }   TMainForm = class(TForm)    Score: TLabel;    StartBtn: TButton;    MainPanel: TPanel;    FrameTick: TTimer;    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);    procedure FrameTickTimer(Sender: TObject);    procedure StartBtnClick(Sender: TObject);  private    { private declarations }  public    { public declarations }  end; var  MainForm: TMainForm;  GameField:array[1..w,6..h] of TImage;  Next:array[1..5,1..5] of TImage; implementation {$R *.lfm} { TMainForm }type figura = record               x,y,op,col,spin:integer;             amount: array[1..5,1..5] of boolean              end; var brick,nextbrick:figura; pole:array[1..w,1..h] of record         color:integer;           sost:boolean;          end; i,j,counter:integer; procedure newbrick;   //создание новой фигуры  var option:integer;begin for i:=1 to 5 do  for j:=1 to 5 do  brick.amount[i,j]:=nextbrick.amount[i,j]; brick.x:=nextbrick.x; brick. y:=nextbrick.y; brick.op:=nextbrick.op; brick.col:=nextbrick.col; bric k.spin:=nextbrick.spin; for i:=1 to 5 do  for j:=1 to 5 do   nextbrick.amount[i,j]:=false; MainForm.FrameTick.Interval := normal_tick; randomize; nextbrick.x := Random(5)+1; nextbrick.y := 1;  option:=random(7); nextbrick.op:=option; nextbrick.col:=random(7)+1; n extbrick.col:=random(4); case option of  0 : begin // J        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;      nextbrick.amount[3,4]:=true;        nextbrick.amount[2,4]:=true       end;  1 : begin  //L        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;        nextbrick.amount[3,4]:=true;      nextbrick.amount[4,4]:=true       end;  2 : begin  //S        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;      nextbrick.amount[2,3]:=true;        nextbrick.amount[4,2]:=true       end;  3 : begin  //Z        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;        nextbrick.amount[2,2]:=true;      nextbrick.amount[4,3]:=true       end;  4 : begin  //T        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;      nextbrick.amount[2,3]:=true;        nextbrick.amount[4,3]:=true       end;  5 : begin  //I        nextbrick.amount[3,2]:=true;        nextbrick.amount[3,3]:=true;        nextbrick.amount[3,4]:=true;      nextbrick.amount[3,5]:=true       end;  6 : begin   //cube        nextbrick.amount[3,4]:=true;        nextbrick.amount[3,3]:=true;      nextbrick.amount[4,4]:=true;        nextbrick.amount[4,3]:=true       end; end;end; procedure chekline;     //проверка линииvar line:array[6..h] of boolean;    k:integer;begin for i:=h downto 6 do begin  line[i]:=true;  for j:=1 to w do  begin   if not pole[j,i].sost then   begin    line[i]:= false;    break;   end;  end;  if line[i] then  begin   counter := counter + 1;   for j:=i downto 7 do    for k:=1 to w do     pole[j,k].sost:=pole[j-1,k].sost;   for j:=1 to w do    pole[6, j].sost:=false;  end; MainForm.Score.Caption:='Счёт: '+IntToStr(counter); end;end; procedure fallbrick; //падение фигурыbegin if (brick.op<>6) then  if (brick.x>=w-4) then brick.x:=w-3  else if (brick.op<>7) then       begin        if (brick.x<=0) then brick.x:=1       end       else if (brick.x<=-1) then brick.x:=0 else if (brick.x<=-1) then brick.x:=0       else if (brick.x>=w-3) then brick.x:=w-2;  for i:=1 to w do   if (pole[i,6].sost) then   begin    MainForm.FrameTick.Enabled := false;    ShowMessage('Игра Окончена!');   end;  if brick.spin=0 then   case brick.op of    0:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+4].sost) or (pole[brick.x+2,brick.y+4].sost) then  //J      begin        pole[brick.x+1,brick.y+3].sost:=true;        pole[brick.x+1,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        newbrick;       end;    1:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+4].sost) or (pole[brick.x+2,brick.y+4].sost) then  //L      begin        pole[brick.x+3,brick.y+3].sost:=true;        pole[brick.x+3,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        newbrick;       end;    2: if (brick.y>=h-4) or (pole[brick.x+1,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+3,brick.y+2].sost) then  //S      begin        pole[brick.x+1,brick.y+2].sost:=true;      pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+3,brick.y+1].sost:=true;        pole[brick.x+3,brick.y+1].color:=brick.col;        newbrick;       end;    3:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+2].sost) then  //Z      begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+1].color:=brick.col;        newbrick;       end;    4:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+3].sost) then  //T      begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        newbrick;       end;    5:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+5].sost)  then  //I       begin        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+4].sost:=true;        pole[brick.x+2,brick.y+4].color:=brick.col;        newbrick;       end;    6:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+4].sost)  or (pole[brick.x+3,brick.y+4].sost) then  //cube       begin        pole[brick.x+3,brick.y+3].sost:=true;        pole[brick.x+3,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        newbrick;       end;    end; ---------------------------------------------------------------------- sdfteh · 2016-11-04 21:28 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if brick.spin=1 then   case brick.op of    0:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+3].sost) then  //J       begin        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+1].color:=brick.col;        newbrick;       end;    1:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+4].sost) then  //L       begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+3].sost:=true;        pole[brick.x+1,brick.y+3].color:=brick.col;        newbrick;       end;    2:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+3,brick.y+4].sost)  then  //S       begin        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+3].sost:=true;        pole[brick.x+3,brick.y+3].color:=brick.col;        newbrick;       end;    3:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+3,brick.y+3].sost)  then  //S       begin        pole[brick.x+3,brick.y+1].sost:=true;        pole[brick.x+3,brick.y+1].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        newbrick;       end;    4:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+3,brick.y+3].sost)  then  //T       begin        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        newbrick;       end;    5:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x,brick.y+3].sost) then  //I       begin        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x,brick.y+2].sost:=true;        pole[brick.x,brick.y+2].color:=brick.col;        newbrick;       end;    6:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+4].sost)  or (pole[brick.x+2,brick.y+4].sost) then  //cube       begin        pole[brick.x+1,brick.y+3].sost:=true;        pole[brick.x+1,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        newbrick;       end;    end;  if brick.spin=2 then   case brick.op of    0:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+2].sost) or (pole[brick.x+2,brick.y+4].sost) then  //J       begin        pole[brick.x+3,brick.y+1].sost:=true;        pole[brick.x+3,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        newbrick;       end;    1:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+2].sost) or (pole[brick.x+2,brick.y+4].sost) then  //L       begin        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        newbrick;       end;    2: if (brick.y>=h-4) or (pole[brick.x+1,brick.y+4].sost) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+3,brick.y+3].sost) then  //S       begin        pole[brick.x+1,brick.y+3].sost:=true;      pole[brick.x+1,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        newbrick;       end;    3:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+4].sost) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+1,brick.y+3].sost) then  //Z       begin        pole[brick.x+3,brick.y+3].sost:=true;      pole[brick.x+3,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        newbrick;       end;    4:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+1,brick.y+3].sost) then  //T       begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        newbrick;       end;    5:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+4].sost)  then  //I        begin        pole[brick.x+2,brick.y].sost:=true;        pole[brick.x+2,brick.y].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        newbrick;       end;    6:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+2].sost)  or (pole[brick.x+2,brick.y+2].sost) then  //cube        begin        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        newbrick;       end;    end;  if brick.spin=3 then   case brick.op of    0:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+4].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+3].sost) then  //J       begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+3].sost:=true;        pole[brick.x+3,brick.y+3].color:=brick.col;        newbrick;       end;    1:if (brick.y>=h-4) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+1,brick.y+3].sost) then  //L       begin        pole[brick.x+3,brick.y+2].sost:=true;      pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+1].sost:=true;        pole[brick.x+3,brick.y+1].color:=brick.col;        newbrick;       end;    2:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+3].sost) or (pole[brick.x+2,brick.y+4].sost)  then  //S       begin        pole[brick.x+1,brick.y+1].sost:=true;        pole[brick.x+1,brick.y+1].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        newbrick;       end;    3:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+4].sost) or (pole[brick.x+2,brick.y+3].sost)  then  //S       begin        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+1,brick.y+3].sost:=true;        pole[brick.x+1,brick.y+3].color:=brick.col;        newbrick;       end;    4:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+4].sost) or (pole[brick.x+1,brick.y+3].sost)  then  //T       begin        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+3].sost:=true;        pole[brick.x+2,brick.y+3].color:=brick.col;        newbrick;       end;    5:if (brick.y>=h-4) or (pole[brick.x+1,brick.y+3].sost) or (pole[brick.x+2,brick.y+3].sost) or (pole[brick.x+3,brick.y+3].sost) or (pole[brick.x+4,brick.y+3].sost) then  //I       begin        pole[brick.x+1,brick.y+2].sost:=true;        pole[brick.x+1,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+4,brick.y+2].sost:=true;        pole[brick.x+4,brick.y+2].color:=brick.col;        newbrick;       end;    6:if (brick.y>=h-4) or (pole[brick.x+2,brick.y+3].sost)  or (pole[brick.x+3,brick.y+3].sost) then  //cube       begin        pole[brick.x+3,brick.y+1].sost:=true;        pole[brick.x+3,brick.y+1].color:=brick.col;        pole[brick.x+2,brick.y+1].sost:=true;        pole[brick.x+2,brick.y+1].color:=brick.col;        pole[brick.x+3,brick.y+2].sost:=true;        pole[brick.x+3,brick.y+2].color:=brick.col;        pole[brick.x+2,brick.y+2].sost:=true;        pole[brick.x+2,brick.y+2].color:=brick.col;        newbrick;       end;    end;end; procedure flipbrick; //поворот var temp:boolean;begin brick.spin:= brick.spin+1; brick.spin:= brick.spin mod 4; temp:=brick.amount[1,1]; brick.amount[1,1]:=brick.amount[1,5];  brick.amount[1,5]:=brick.amount[5,5]; brick.amount[5,5]:=brick.amount[ 5,1]; brick.amount[5,1]:=temp; temp:=brick.amount[1,2]; brick.amount[1 ,2]:=brick.amount[2,5]; brick.amount[2,5]:=brick.amount[5,4]; brick.am ount[5,4]:=brick.amount[4,1]; brick.amount[4,1]:=temp; temp:=brick.amo unt[1,3]; brick.amount[1,3]:=brick.amount[3,5]; brick.amount[3,5]:=bri ck.amount[5,3]; brick.amount[5,3]:=brick.amount[3,1]; brick.amount[3,1 ]:=temp; temp:=brick.amount[1,4]; brick.amount[1,4]:=brick.amount[4,5] ; brick.amount[4,5]:=brick.amount[5,2]; brick.amount[5,2]:=brick.amoun t[2,1]; brick.amount[2,1]:=temp; temp:=brick.amount[2,2]; brick.amount [2,2]:=brick.amount[2,4]; brick.amount[2,4]:=brick.amount[4,4]; brick. amount[4,4]:=brick.amount[4,2]; brick.amount[4,2]:=temp; temp:=brick.a mount[2,3]; brick.amount[2,3]:=brick.amount[3,4]; brick.amount[3,4]:=b rick.amount[4,3]; brick.amount[4,3]:=brick.amount[3,2]; brick.amount[3 ,2]:=tempend; procedure printfield;  //вывод поляbegin chekline; fallbrick; for i:=1 to w do  for j:=1 to h do   begin    GameField[i,j]:=TImage.Create(MainForm);    GameField[i,j].Parent:=MainForm;    GameField[i,j].Height:=a;    GameField[i,j].Width:=a;    GameField[i,j].Top:=j*a+30;    GameField[i,j].left:=i*a+15   end; for i:=1 to w do  for j:=1 to h do   if pole[i,j].sost then    GameField[i,j].Picture.LoadFromFile('.\img\ '+IntToStr(pole[i,j].color)+'.png')   else    GameField[i,j].Picture.LoadFromFile('.\img\0.png'); for i:=1 to 5 do  for j:=1 to 5 do   if brick.amount[i,j] then    GameField[brick.x+i,br ick.y+j].Picture.LoadFromFile('.\img\'+IntToStr(brick.col)+'.png'); fo r i:=1 to 5 do  for j:=1 to 5 do   begin    Next[i,j]:=TImage.Create(MainForm);    Next[i,j].Parent:=MainForm;    Next[i,j].Height:=a;    Next[i,j].Width:=a;    Next[i,j].Top:=j*a+60;    Next[i,j].left:=i*a+283   end; for i:=1 to 5 do  for j:=1 to 5 do   if nextbrick.amount[i,j] then    Next[i,j].Picture.LoadFromFile('.\img\'+IntToStr(brick.col)+'.png')   else    Next[i,j].Picture.LoadFromFile('.\img\0.png');end; procedure TMainForm.StartBtnClick(Sender: TObject);begin  counter := 0;  newbrick;  newbrick;  for i:=1 to w do    for j:=1 to h do      pole[i,j].sost:=false;end; procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);begin if(not FrameTick.Enabled) then begin   exit; end; if (Key = 37) then begin   brick.x:=brick.x-1;   printfield; end else if (Key = 39) then begin   brick.x := brick.x+1;   printfield; end else if (Key  = 40) then   Frametick.Interval:=fast_tick else if (Key = 38) then  begin    flipbrick;    printfield;  endend; procedure TMainForm.FrameTickTimer(Sender: TObject);begin  brick.y:=brick.y+1;  printfieldend; end. ---------------------------------------------------------------------- sdfteh · 2016-11-04 21:34 image folder ---------------------------------------------------------------------- molly · 2016-11-04 21:38 Quote from: sdfteh on November 04, 2016, 10:28:10 pmOk but its too big That is why there is a option inside lazarus named publish project. You can zip up that directory and attach it to a post. The things you have posted is still not the complete project as it is missing the form(s) itself as wel as the project file. ---------------------------------------------------------------------- lainz · 2016-11-04 21:42 Remember to copy the images again when you publish, these get stripped from the publish with the default options. If the size doesn't fit the forum restriction, upload it somewhere else like in Dropbox for example. ---------------------------------------------------------------------- sdfteh · 2016-11-04 22:21 https://www.dropbox.com/sh/bmnaswh4md2zcq0/AABWfZ0J72qM93ReUJOjtUR- a?dl=0 Ok ---------------------------------------------------------------------- Blaazen · 2016-11-05 00:19 This took me a while to understand because error message is misleading. You declaredCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GameField:array[1..w,6..h] of TImage; (note the "6") and then you loopCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i for i:=1 to w do  for j:=1 to h do   begin    GameField[i,j]:=TImage.Create(MainForm);    GameField[i,j].Parent:=MainForm;which means that you access memory that is out of the array. You can switch on Range checking in Projet Options / Debugging to catch this kind of bugs. ---------------------------------------------------------------------- sdfteh · 2016-11-05 08:51 Thanks a lot men)) ---------------------------------------------------------------------- wp · 2016-11-05 09:03 Although not wrong, you should accustom yourself to begin array indexes with 0 (instead of 1) which is used all over Object Pascal. This way you can avoid the mind twist needed when handling both 0- and 1-based index conventions. Using both conventions will be a permant source of error, believe me.