While play = "true"
If directionx = "Left" Then
x = x + 2
md = 1
ms = ms + .1
EndIf
If directionx = "Right" Then
x = x - 2
md = 2
ms = ms + .1
EndIf
If ms > 5 Then
ms = ms - 4
EndIf
y = y + directiony
If x < -32 Then
x = x + 32
ElseIf x > 0 Then
x = x -32
EndIf
If y < -32 Then
y = y + 32
ElseIf y > 0 Then
y = y -32
EndIf
Shapes.Move(sea,x,y)
Shapes.HideShape(man[mdlast][mslast])
Shapes.ShowShape(man[md][Math.Floor(ms)])
mdlast = md
mslast = Math.Floor(ms)
If debug = "on" Then
DebugData()
EndIf
Program.Delay(10)
EndWhile
Sub OnKeyDown
key = GraphicsWindow.LastKey
If key = "Left" Then
directionx = "Left"
ElseIf key = "Right" Then
directionx = "Right"
ElseIf key = "Up" Then
directiony = 1
ElseIf key = "Down" Then
directiony = -1
ElseIf key = "Escape" Then
Program.End()
EndIf
EndSub
Sub OnKeyUp
key = GraphicsWindow.LastKey
If key = "Right" Or key = "Left" Then
directionx = ""
ElseIf key = "Up" Or key = "Down" Then
directiony = ""
EndIf
EndSub