Jumat, 09 November 2012
MEMBUAT GAME TANGKAP TWETTY
dan ini adalah scriptnya...
download disini..
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Timer1: TTimer;
Image4: TImage;
Image3: TImage;
Image2: TImage;
Image1: TImage;
Label2: TLabel;
lbl60: TLabel;
Label4: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Image1Click(Sender: TObject);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Button2Click(Sender: TObject);
procedure Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image4Click(Sender: TObject);
procedure Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image2Click(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
procedure aktif;
procedure nonaktif;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure tform1.aktif;
begin
Edit1.Text:='0' ;
lbl60.Tag:=60;
Image1.Enabled:=True;
Image2.Enabled:=True;
Image3.Enabled:=True;
Image4.Enabled:=True;
Edit1.Enabled:=True;
Button2.Enabled:=True;
Image4.Visible:=True;
Timer1.Enabled:=True;
end;
procedure tform1.nonaktif;
begin
Image1.Enabled:=false;
Image2.Enabled:=false;
Image3.Enabled:=false;
Image4.Enabled:=false;
Edit1.Enabled:=false;
Button2.Enabled:=false;
Timer1.Enabled:=false;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
nonaktif;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
aktif;
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
Image1.Visible:=True;
Edit1.text:=IntToStr(strtoint(Edit1.text)+20);
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image1.Left:=Random(Left);
Image1.Top:=Random(Top);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image2.Left:=Random(Left);
Image2.Top:=Random(Top);
end;
procedure TForm1.Image3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image3.Left:=Random(Left);
Image3.Top:=Random(Top);
end;
procedure TForm1.Image4Click(Sender: TObject);
begin
Image4.Visible:=True;
Edit1.text:=IntToStr(strtoint(Edit1.text)+20);
end;
procedure TForm1.Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Image4.Left:=Random(Left);
Image4.Top:=Random(Top);
end;
procedure TForm1.Image2Click(Sender: TObject);
begin
Image2.Visible:=True;
Edit1.text:=IntToStr(strtoint(Edit1.text)+20);
end;
procedure TForm1.Image3Click(Sender: TObject);
begin
Image3.Visible:=True;
Edit1.text:=IntToStr(strtoint(Edit1.text)+20);
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
if Edit1.Text='100'then
begin
nonaktif;
ShowMessage('anda menang');
end
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
lbl60.Tag:=lbl60.Tag-1;
lbl60.Caption:=inttostr(lbl60.Tag);
if lbl60.Tag=0 then
begin
Image1.Enabled:=false;
Image2.Enabled:=false;
Image3.Enabled:=false;
Image4.Enabled:=false;
Edit1.Enabled:=false;
Button1.Enabled:=false;
Button2.Enabled:=false;
Timer1.Enabled:=false;
ShowMessage('Game Over');
Form1.close;
end;
end;
end.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar