# How would I be able to get a game over screen using the pause function?

I am having problems with my snake game, when the snake collides with itself it draws a "game over" image in the background, but only while it's colliding with itself. I want it to behave like the pause function, so that as soon as the snake collides with itself it draws an image on the screen and stops the game play. And then how would you be able to restart or to quit the game?

I just have this for the detection at the moment:

if (snakeHeadRectangle.Intersects(snakeBodyRectangleArray[bodyNumber]))
{

spriteBatch.Draw(textureGameOver, gameOverPosition, Color.White);
}


Thanks

I had a boolean variable isGameRunning which is set to true if the game is on. Update the game only when this variable is true. After collision, you can set this to false.
enum GameStates

instead of just true and false.
To restart the game, create an Initialize() function to reset the settings.