Private Sub Form_Load()
Dim tmp As Long, t As Long, coun As Integer
Me.Show
mainPic.SetFocus
While Not gmloop
t = GetTickCount - tmp
If t > 1000 Then Me.Caption = "Attack - FPS : " & coun: coun = 0: tmp = GetTickCount
MoveAll
DrawAll
Chk4IndianArround
ChkCollision
DoEvents
DoEvents
coun = coun + 1
Wend
End Sub
Public Sub MoveAll()
Dim i As Integer
Static tmp As Long
If GetTickCount - tmp > 120 Then
tmp = GetTickCount
For i = 0 To UBound(USol)
USol(i).MoveMe
Next
Ind.MoveMe
End If
End Sub
Public Sub DrawAll()
Dim i As Integer
Static tmp As Long
Dim won As Long
Ind.DrawMe frmMain.mainPic
For i = 0 To UBound(USol)
USol(i).DrawMe frmMain.mainPic
Next
If GetTickCount - tmp > 120 Then
frmMain.mainPic.Cls
tmp = GetTickCount
frmMain.writelog
Ind.NextStep
For i = 0 To UBound(USol)
USol(i).NextStep
won = won + USol(i).Life
Next
End If
If won = -2 - 2 * UBound(USol) Then _
frmMain.mainPic.Print "You Have destroyed all the enemies": _
frmMain.mainPic.Print "You are victorious"
End Sub