unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, jpeg, ExtCtrls, mmsystem;
type
TForm2 =
class(TForm)
Image1: TImage;
Button1: TButton;
Button2: TButton;
Button3: TButton;
ScrollBar1: TScrollBar;
ScrollBar2: TScrollBar;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Shape1: TShape;
Timer1: TTimer;
Label9: TLabel;
Label10: TLabel;
Button4: TButton;
Image2: TImage;
Label7: TLabel;
Label8: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure ScrollBar1Change(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
xo,yo : integer;
t : real;
punkte : integer;
implementation
uses Unit1, Unit3;
{$R *.DFM}
procedure TForm2.Timer1Timer(Sender: TObject);
begin
scrollbar1.enabled := false;
scrollbar2.enabled := false;
t := t + 0.1;
shape1.Left := round(xo+t*scrollbar2.position*cos(scrollbar1.position*pi/180)) ;
shape1.top := round(yo-t*scrollbar2.position*sin(scrollbar1.position*pi/180)+9.81/2*t*t);
if shape1.Top >= 600
then begin timer1.enabled := false;
scrollbar1.enabled := true;
scrollbar2.enabled := true;
label10.visible := true;
end;
if (shape1.left > 734)
and (shape1.left < 770)
then
if (shape1.top > 51)
and (shape1.top < 68 )
then
begin
timer1.enabled := false;
scrollbar1.enabled := true;
scrollbar2.enabled := true;
label9.visible := true;
punkte := punkte + 1;
label8.Caption := inttostr(punkte);
end;
end;
procedure TForm2.ScrollBar1Change(Sender: TObject);
begin
label3.Caption := inttostr (scrollbar1.position);
end;
procedure TForm2.ScrollBar2Change(Sender: TObject);
begin
label4.caption := inttostr(scrollbar2.position);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
scrollbar1.enabled := false;
scrollbar2.enabled := false;
xo := shape1.left;
yo := shape1.top;
t := 0;
timer1.enabled := true;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
scrollbar1.enabled := true;
scrollbar2.enabled := true;
shape1.left := 448;
shape1.top := 248;
t := 0;
label9.Visible := false;
label10.Visible := false;
timer1.enabled := false;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
form1.close;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
form3.show;
form2.close;
end;
procedure TForm2.FormActivate(Sender: TObject);
begin
label9.Visible := false;
label10.Visible := false;
sndPlaySound('
sirius.wav', SND_ASYNC);
end;
end.