Kamis, 19 April 2012

Form Game Saat Aktif









Form game saat timer waktu habis.










Form game saat button Stop di Klik









= = = = = = = = = = = = = = = == = = = == = = = = = = = = = = = = = === = = == == = =
codingnya   :
implementation

{$R *.dfm}
procedure tform1.aktif;
begin
image1.enabled:=true;
image2.enabled:=true;
image3.enabled:=true;
image4.enabled:=true;
image5.enabled:=true;
edit1.Enabled:=true;
button2.Enabled:=true;
image1.Visible:=true;
image2.Visible:=true;
image3.Visible:=true;
image4.Visible:=true;
image5.Visible:=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;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
nonaktif;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
aktif;
button1.Enabled:=true;
panel_timer.Caption:='10';
timer1.Enabled:=true;


end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if(application.MessageBox
('Sumpah Lu Mau keluar dari Game??','Konfirmasi',MB_YesNo)=ID_Yes) then
close;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image1.Left:=random(left);
image1.top:=random(top);
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.Image1Click(Sender: TObject);
begin
image1.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Image2Click(Sender: TObject);
begin
image2.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
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.Timer1Timer(Sender: TObject);
var
waktu:integer;
begin

if panel_timer.Caption='0' then
begin
timer1.Enabled:=false;
showmessage('WAKTUNYA ABIS!');
button1.Enabled:=false;
showmessage('SORY BOS LU KALAH!!!!!');
close;

end
else
begin
waktu:=strtoint(panel_timer.Caption);
waktu:=waktu-1;
panel_timer.Caption:=inttostr(waktu);

end;
end;
end.