unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, dbf, FileUtil, LResources, Forms, Controls, Graphics,
Dialogs, ExtCtrls, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Image1: TImage;
Image10: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
Image8: TImage;
Image9: TImage;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Timer1: TTimer;
Timer2: TTimer;
Timer3: TTimer;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
Image1.visible := true;
Image2.visible := false;
Image3.visible := true;
Image4.visible := false;
Image5.visible := false;
Image6.visible := true;
Image7.visible := false;
Image8.visible := true;
timer1.Enabled:=false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if Image1.visible = true
then begin
timer1.interval := 5000;
Image1.visible := false;
Image2.visible := true;
Image3.visible := false;
Image4.visible := true;
Image5.visible := true;
Image6.visible := false;
Image7.visible := true;
Image8.visible := false;
end
else begin
Image1.visible := true;
Image2.visible := false;
Image3.visible := true;
Image4.visible := false;
Image5.visible := false;
Image6.visible := true;
Image7.visible := false;
Image8.visible := true;
timer1.enabled := false;
end
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
if Image2.visible = true
then begin
Image9.top := Image9.top +10
end ;
if Image9.top > Form1.height //Problem ist, dass der Hund irgendwann überfahren wird.
![Smile](images/smilies/smile.png)
then
Image9.top := 0;
end;
procedure TForm1.Timer3Timer(Sender: TObject);
begin
if Image1.visible = true
then begin
Image10.left := Image10.left +10;
end
;
if Image10.left > Form1.width
then
Image10.left := 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
timer1.enabled := true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
timer1.enabled := true;
end;
initialization
{$I unit1.lrs}
end.