To beat this game, all you have to do is get to the big green dot. After that, you go to the next level. But don't touch the red walls, or else you will be teleported to the start of the level again, and have to start over. Did I mention that this game runs on only one sprite and one script? I didn't think it was possible until I saw how someone else did it. Look in the code yourself if you don't believe me.
Thanks to @BoltBait for the basic concept of the game.