Click see inside to really understand the script.
I just got this idea of trying to re-create blocks without actually using them, so I started with the glide because it was pretty easy. But it only glides on X :P MEEEEEEEEEEEEE... Check out the one for Y: https://scratch.mit.edu/projects/144561851/