keterangan :
2 Buah Timer dengan nama
tmrmove
timer1
importlah gambar tanki
tambahkan 1 label sebagai score
dan 1 karakter serta juga 3 buah command button.
dan masuklah ke bagian kode, pastekan kode dibawah ini
Private Sub Command1_Click()
If Command1.Caption = "Flap" Then
If Not started Then
started = True
Timer1.Enabled = True
tmrMove.Enabled = True
End If
imgBird.Picture = LoadPicture(App.Path & "\img\bird-up.gif")
imgBird.Top = imgBird.Top - 600
Else
NewGame
End If
End Sub
End Sub
NewGame
End Sub
Randomize
Dim value As Integer
value = CInt(Int((1000 * Rnd()) + 615))
If Image1.Left <= (Image1.Width - (Image1.Width * 2)) Then
Image2.Height = value
Image1.Left = Me.Width
End If
If Image3.Left <= (Image3.Width - (Image3.Width * 2)) Then
Image3.Height = value
Image3.Left = Me.Width
End If
If Image5.Left <= (Image5.Width - (Image5.Width * 2)) Then
Image5.Left = Image6.Left + (Image6.Width - 180)
End If
If Image6.Left <= (Image6.Width - (Image6.Width * 2)) Then
Image6.Left = Image5.Left + (Image5.Width - 180)
End If
End If
End Sub