unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Image1: TImage;
    Image10: TImage;
    Image11: TImage;
    Image12: TImage;
    Image13: TImage;
    Image14: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Image6: TImage;
    Image7: TImage;
    Image8: TImage;
    Image9: TImage;
    Timer1: TTimer;
    Timer2: TTimer;
    Timer3: TTimer;
    Timer4: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer3Timer(Sender: TObject);
    procedure Timer4Timer(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1; flag,flag1,flag2,flag3: integer;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Timer1Timer(Sender: TObject);
begin
    If flag=0 then
      begin
        Image2.Picture:=Image1.Picture;
        Image2.Left:=Image2.Left-20;

        flag:=1;
        end
    else
        begin
             Image2.Picture:=Image3.Picture;
             Image2.Left:=Image2.Left-20;

             flag:=0;
        end;

    If flag2=0 then
      begin
        Image8.Picture:=Image6.Picture;
        flag2:=1;
        end
    else
      begin
        Image8.Picture:=Image7.Picture;
        flag2:=0;
      end;

      If Image2.Left<=-Image2.Width then Image2.Left:=820;
      If (Image2.Left<Image11.left+50)and(Image2.Left>Image11.left-50)
        then Image10.Visible:=true else Image10.Visible:=false;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
      Image8.Left:=400+random(100);
      Image8.Top:=50+random(100);
end;

procedure TForm1.Timer3Timer(Sender: TObject);
begin
   If flag1=0 then
      begin
        Image11.Picture:=Image9.Picture;
        flag1:=1;
      end
    else
      begin
        Image11.Picture:=Image5.Picture;
        flag1:=0;
      end;
end;

procedure TForm1.Timer4Timer(Sender: TObject);
begin
    If flag3=0 then
      begin
        Image14.Picture:=Image12.Picture;
        Image14.Left:=Image14.Left+10;

        flag3:=1;
        end
    else
        begin
             Image14.Picture:=Image13.Picture;
             Image14.Left:=Image14.Left+10;

             flag3:=0;
        end;
      If Image14.Left>=Form1.Width then Image14.Left:=-20;
      If (Image14.Left<Image11.left+50)and(Image14.Left>Image11.left-50)
        then Image10.Visible:=true else Image10.Visible:=false;
end;

end.

