Game end state detection

Checks wether the player has reached the goal and restarts the game.