Hi, I want to move a shape (label) when I press WASD around a maze. I got what I have so far off the net, but I cant figure out whats wrong with it.
Public x 1 'This is whats wrong - it says "End of statement expected" when mouse over
Public y 1 'the "1"
Private Sub Form_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
' if keypressed is right move the shape three more
' spaces to the right
If KeyCode = 68 Then
x = x + 3
shape1.Move(x, y)
End If
' if keypressed is left move the shape three more
' spaces to the left
If KeyCode = 65 Then
x = x - 3
shape1.Move(x, y)
End If
If KeyCode = 83 Then
y = y + 3
shape1.Move(x, y)
End If
If KeyCode = 86 Then
y = y - 3
shape1.Move(x, y)
End If
End Sub
Note Im completely new to this so keep it simple please!
Thanks!