-
Notifications
You must be signed in to change notification settings - Fork 1
/
unit1.pas
98 lines (79 loc) · 1.58 KB
/
unit1.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Buttons, Unit2,MMsystem;
type
{ TForm1 }
TForm1 = class(TForm)
Image1: TImage;
Image10: TImage;
Image11: TImage;
Image12: TImage;
Image13: TImage;
Image14: TImage;
Image15: TImage;
Image16: TImage;
Image17: TImage;
Image18: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
Image8: TImage;
Image9: TImage;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Image2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
n: integer = 1;
tmp1, tmp2 : integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
Position:= poScreenCenter;
tmp1 := Form1.Image2.Top;
tmp2 := Form1.Image2.Left;
PlaySound('mic.wav',0,SND_ASYNC);
end;
procedure TForm1.Image2Click(Sender: TObject);
begin
Form2.Show;
Form1.Hide;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (n < 3) then
begin
Form1.Image2.Top:= Form1.Image2.Top - n;
end
else if (n < 5) then
begin
Form1.Image2.Left:= Form1.Image2.Left - n;
end
else if (n < 7) then
begin
Form1.Image2.Top:= Form1.Image2.Top + n;
end
else if (n < 9) then
begin
Form1.Image2.Left := Form1.Image2.Left + n;
end
else
begin
Form1.Image2.Top := tmp1;
Form1.Image2.Left := tmp2;
end;
n := n + 1;
end;
end.