setGameOver() function

What exactly this function supposed to do? I don’t understand it a little bit.

From the interface:

Sets the state of the game to game over.

You can read about the effects of a game over in the project description.