Use arrows
The obstacles can be drawn as part of the stage, or it can be a sprite. It just has to be black. The key is at the end of EVERY movement, the sprite needs to not be touching the black. Symmetrical and centered costumes are also very important.