Basically, you have 15 seconds to get to the magic gem. After you touch the portal in the right, you are teleported left again, which is the next level. You win when you touch the magic gem. Spam the left and right arrow keys to move forward.
This came from the book "Super Scratch Programming Adventure". It's a book that teaches you programming by doing a step-by-step tutorial for each game. This is what inspired this program and many others.