main code of the game