Public Sub Walk(Direction As Integer)
Select Case Direction
Case D_NORTH
posY = posY - Speed
Movement = Movement + Speed
Case D_SOUTH
posY = posY + Speed
Movement = Movement + Speed
Case D_EAST
posX = posX + Speed
Movement = Movement + Speed
Case D_WEST
posX = posX - Speed
Movement = Movement + Speed
Case D_LAST
Select Case lastMov
Case D_NORTH
If 1 = Int(Movement) Then
Movement = 0
actMov = D_NONE
lastMov = D_NONE
Look = Act_Look + L_NORTH
ElseIf Movement = 0.3 Then
Look = Act_Look + L_NORTH + 1
posY = posY - Speed
Movement = Movement + Speed
ElseIf Movement = 0.3 Then
Look = Act_Look + L_NORTH + 2
posY = posY - Speed
Movement = Movement + Speed
Else
posY = posY - Speed
Movement = Movement + Speed
End If
Case D_SOUTH
If 1 = Int(Movement) Then
Movement = 0
actMov = D_NONE
lastMov = D_NONE
Look = Act_Look + L_SOUTH
ElseIf Movement = 0.3 Then
Look = Act_Look + L_SOUTH + 1
posY = posY + Speed
Movement = Movement + Speed
ElseIf Movement = 0.6 Then
Look = Act_Look + L_SOUTH + 2
posY = posY + Speed
Movement = Movement + Speed
Else
posY = posY + Speed
Movement = Movement + Speed
End If
Case D_EAST
If 1 = Int(Movement) Then
Movement = 0
actMov = D_NONE
lastMov = D_NONE
Look = Act_Look + L_EAST
ElseIf Movement = 0.3 Then
Look = Act_Look + L_EAST + 1
posX = posX + Speed
Movement = Movement + Speed
ElseIf Movement = 0.6 Then
Look = Act_Look + L_EAST + 2
posX = posX + Speed
Movement = Movement + Speed
Else
posX = posX + Speed
Movement = Movement + Speed
End If
Case D_WEST
If 1 = Int(Movement) Then
Movement = 0
actMov = D_NONE
lastMov = D_NONE
Look = Act_Look + L_WEST
ElseIf Movement = 0.3 Then
Look = Act_Look + L_WEST + 1
posX = posX - Speed
Movement = Movement + Speed
ElseIf Movement = 0.6 Then
Look = Act_Look + L_WEST + 2
posX = posX - Speed
Movement = Movement + Speed
Else
posX = posX - Speed
Movement = Movement + Speed
End If
End Select
End Select
Debug.Print Movement
End Sub