Option Explicit
' 38 Up
' 40 Down
' 37 Left
' 39 Right
Private Sub Form_Load()
tmrEnemy1.Enabled = True
lblCrash.Visible = False
myScore = 0
txtScore.Text = myScore
End Sub
Private Sub picCig_KeyDown(KeyCode As Integer, Shift As Integer)
picCig.SetFocus
If KeyCode = 38 Then
picCig.Top = picCig.Top - 2
If picCig.Top = 42 Then
lblCrash.Visible = True
txtScore.Text = txtScore.Text + myScore + 50
End If
End If
If KeyCode = 40 Then picCig.Top = picCig.Top + 2
If KeyCode = 37 Then picCig.Left = picCig.Left - 2
If KeyCode = 39 Then picCig.Left = picCig.Left + 2
End Sub
Private Sub txtAscii_KeyDown(KeyCode As Integer, Shift As Integer)
txtAscii.Text = KeyCode
End Sub
Private Sub tmrEnemy1_Timer()
Dim myEPos As Integer
picEnemy.Left = picEnemy.Left + 2 ' Move 2px Right til End
txtDebug.Text = txtDebug.Text & "Enemy Position = " & picEnemy.Left & vbCrLf
' For myEPos = 0 To 1
If picEnemy.Left = 264 Then GoTo otherway
: otherway
picEnemy.Left = picEnemy.Left - 2
End Sub