Try this instead:
walk=ExtractAnimSeq(ninja,1,14) While Not KeyHit(1) if keydown(key_w) MoveEntity ninja,0,0,.25 If not animseq(ninja) = walk Animate ninja,1,walk,10 EndIf endif UpdateWorld RenderWorld Flip Wend