Hi, I'm making a game called Alien Invasion, and the main happening in this game is that an ufo appears on the screen and u try to shoot it before it dissapears.
I've written the code to make the ufo appear in random places, but i can't make the code to understand that i'm clicking on the ufo and to register hits/misses and also make the ufo dissapear if i use to much time...
this is the code i got so far:
Private Sub Form_Load()
Hits = 0
Life = 3
frmMainpage.Top = 0
frmMainpage.Left = 0
frmMainpage.Height = 567 * 15.15
frmMainpage.Width = 567 * 21.25
Run
End Sub
Private Sub imgAlien_Click()
Time = 0
Hits = Hits + 1
lblHit = Hit
Run
End Sub
Private Sub Run()
Dim Top As Single
Dim Left As Single
Dim b As Long
b = 0
Do While b <= 4
Randomize
Topp = Rnd(1) * (567 * 15)
Venstre = Rnd(1) * (567 * 21)
If Topp > 567 * 12 Then
Topp = 567 * 10
ElseIf Venstre > 567 * 17 Then
Venstre = 567 * 16
End If
With imgAlien
.Visible = True
.Top = Top
.Left = Left
End With
For Tid = 0 To 900000
Next Tid
b = b + 1
Loop
End Sub
This make the ufo appear on random places, but i need to make the program stop, register hits and then run again...
How do i do this?
