Ok, I got it working, here is the complete code.
But maybe it can be more compact, for instance the procedure StopWalk. I found it cumbersome to
repeatedly have to switch off animations on changing sprite screens so I’m open for suggestions on improvement.
update:
(edited and moved to topic: “Collision Course”