I would like to give the option to the player of restarting the game but I haven't found any solution to it.
Could you have it where the button closes the window the game is in, creates a new window and call the game in the new window?