Akhirnya bisa buat game juga, walaupun cuma game sederhana...hehe....Sebenarnya game ini bukan game kejar maling awalnya game ini adalah game kejar kelinci
entah tau kenapa di benak saya pengen membuat beda dari yang lain game ini adalah salah satu tugas mata kuliah Pemograman Visual II (TK)
Setiap pertemuan mahasiswa posting tugasnya ke blog kebetulan saya mendapatkan tugas seperti ini baru pertama kali saya dapatkan.
Untuk membuat game sederhana ini tidak begitu sulit sebenarnya cukup simple asal kita benar-benar tekun dan teliti ketika pembuatan listingnya jangan sampai error ( termasuk saya sendiri beberapa kali error baru bisa..ckckckck..)
Nah di bawah ini adalah gambar game yang sudah jadi yang saya printscreen dari aplikasi dan kalau ingin dwoanload gamenya silahkan klik link di bawah gambarnya, untuk membuat program ini kita harus install Delphi 7 di PC .
selamat mencoba !!
selamat mencoba !!
LISTING PROGRAM GAME SEDERHANA
private
{ 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('AYO TANGKAP MALING GAK BISA DI TANGKEP BERARTI GAME OVER?');
close;
end;
end.
private
{ 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('AYO TANGKAP MALING GAK BISA DI TANGKEP BERARTI GAME OVER?');
close;
end;
end.
Tidak ada komentar:
Posting Komentar