Прошу прощения. Но не пойму в чем ошибка. пол часа сидел, думал исправлял. Не получается. Походу это никогда не закончится :D

Graphics 800,600
SetBuffer BackBuffer()
AppTitle "The Big Fighter"
Global x = 300
Global y = 300
Global xm = 400
Global ym = 400
Global frame = 0
Global framel = 0
Global frameTime
Global frametimel
Global nado = 0
Global pein = LoadImage("pein.bmp")
Global peinl = LoadImage("peinl.bmp")
Global mario = LoadImage("mario.bmp")
Global cur = LoadImage("cursor.bmp")
Global pein_run = LoadAnimImage("pein_run.bmp",65,85,frame,3)
Global pein_runl = LoadAnimImage("pein_runl.bmp",65,85,framel,3)
MaskImage mario,0,0,0
MaskImage pein,0,0,0
MaskImage peinl,0,0,0
MaskImage pein_run,0,0,0
MaskImage pein_runl,0,0,0
While Not KeyDown(1)
Cls
DrawImage mario,xm,ym
If nado = 0 Then
DrawImage pein,x,y
EndIf
If nado = 10 Then
DrawImage peinl,x,y
EndIf
DrawImage cur,MouseX(),MouseY()
If KeyDown(200) Then
y = y - 1
EndIf
If KeyDown(208) Then
y = y + 1
EndIf
If KeyDown(203) Then
nado = 3 ; 3 - бежать
If MilliSecs() > frameTime + 100 Then
frameTime = MilliSecs()
framel = ( framel + 1 ) Mod 3; 3 - количество кадров
End If
DrawImage pein_runl, x, y, framel
x = x - 4
Else
nado = 10
EndIf
If KeyDown(205) Then
nado = 1 ; 1 - бежать
If MilliSecs() > frameTimel + 100 Then
frameTimel = MilliSecs()
frame = ( frame + 1 ) Mod 3; 3 - количество кадров
End If
DrawImage pein_run, x, y, frame
x = x + 4
Else
nado = 0 ; 0 - стоять на месте
EndIf
HidePointer
Flip
Wend
End
