A while/wend like that will stop script blocking messages handling. Internal thinBasic engine will store all fired messages (up to 500) but your script is not handling it because execution is inside while/wend.
Try another strategy for example just after getmessage(...). If animation is still running just ignore the message and respond only at SPACE pressing.
Eros
Bookmarks