Private Sub mnuMMove_Click()
' hMove and vMove record the number of steps
' through each section of the animation
Dim hMove As Integer
Dim vMove As Integer
Dim delay As Long
' moveFactor indicates which way the face starts
Dim moveFactor As Integer
continue = "yes"
' position the face image
imgEnemy1.Top = 0
imgEnemy1.Left = 0
hMove = 5
vMove = 1095
continue = "yes"
While continue = "yes"
If imgEnemy1.Top = 7860 Then
continue = "no"
imgEnemy1.Top = 0
imgEnemy1.Left = 0
Else
While imgEnemy1.Left < 10000
' pause to allow motion to be seen
For delay = 1 To 400000
' move the face object
imgEnemy1.Left = imgEnemy1.Left + hMove
If imgEnemy1.Left = 10000 Then
hMove = hMove * -1
imgEnemy1.Top = imgEnemy1.Top + vMove
ElseIf imgEnemy1.Left = 0 Then
hMove = hMove * -1
imgEnemy1.Top = imgEnemy1.Top + vMove
End If
Next delay
hold = DoEvents
Wend
End If
Wend
End Sub