All pastes #64405 Raw Edit

TheLegace

public text v1 · immutable
#64405 ·published 2006-06-11 17:18 UTC
rendered paste body
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim DelayLaser As Long
'S/s to move ship right
If (KeyAscii = 83 Or KeyAscii = 115) And imgChar.Left < 8880 Then
    imgChar.Left = imgChar.Left + 400
'A/a moves ship left
ElseIf (KeyAscii = 65 Or KeyAscii = 97) And imgChar.Left > -150 Then
    imgChar.Left = imgChar.Left - 400
'For the SpaceBar
ElseIf KeyAscii = 32 Then
    imgLaser1.Top = imgChar.Top
    imgLaser1.Left = imgChar.Left + 1120
    imgLaser1.Top = imgChar.Top - 300
    While (imgLaser1.Top > imgEnemy1.Top)
        
        For DelayLaser = 1 To 1000000000
        imgLaser1.Top = imgLaser1.Top - 5
        hold = DoEvents
        Next DelayLaser
        Wend
        If imgLaser1.Top = 0 Then
            imgLaser1.Top = 4320
        End If
End If

End Sub


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
continue = "yes"
While continue = "yes"
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
    ElseIf imgEnemy1.Left = 0 Then
    hMove = hMove * -1
    End If
    Next delay
    hold = DoEvents
    
Wend
Wend
End Sub