When game restarts, does not run correctly, how can I fix?

Hi guys! I’m making a game… here’s the source.

When you fail a level, screen comes up asking you to click to restart. When you do this, it goes back to the front screen, but you no longer have any control of the game, or the cursor. how do I fix this?

thanks for your time!