LISTING PROGRAM GAME SEDERHANA
private
{ Private declarations }
public
{ Public declarations } procedure aktif;
procedure nonaktif;
end;
var
Form1: TForm1;
implementation
{ Private declarations }
public
{ Public declarations } procedure aktif;
procedure nonaktif;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.aktif;
begin
image1.Enabled:=true;
image2.Enabled:=true;
image3.Enabled:=true;
image4.Enabled:=true;
image5.Enabled:=true;
button2.Enabled:=true;
image1.visible:=true;
image2.visible:=true;
image3.visible:=true;
image4.visible:=true;
image5.visible:=true;
timer1.Enabled:=true;
end;
procedure TForm1.nonaktif;
begin
image1.Enabled:=false;
image2.Enabled:=false;
image3.Enabled:=false;
image4.Enabled:=false;
image5.Enabled:=false;
edit1.Enabled:=false;
button2.Enabled:=false;
timer1.Enabled:=false;
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
image1.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
nonaktif;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
aktif;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image1.Left:=random(left);
image1.Top:=random(top);
end;
procedure TForm1.Image2Click(Sender: TObject);
begin
image2.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
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.Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image4.Left:=random(left);
image4.Top:=random(top);
end;
procedure TForm1.Image5MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image5.Left:=random(left);
image5.Top:=random(top);
end;
procedure TForm1.Image3Click(Sender: TObject);
begin
image3.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;
procedure TForm1.Image4Click(Sender: TObject);
begin
image4.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;
procedure TForm1.Image5Click(Sender: TObject);
begin
image5.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
if edit1.text='100'then
begin
nonaktif;
showmessage('selamat anda menang');
edit1.Text:='0';
end
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
aktif;
showmessage(' TANGKAP IKAN NYA KALAU TIDAK BISA KE TANGKEP BERARTI GAME OVER?');
close;
end;
end.
Tidak ada komentar:
Posting Komentar