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

Posted by Joachim Velzel on Game Development See other posts from Game Development or by Joachim Velzel
Published on 2012-09-17T05:23:47Z Indexed on 2012/09/17 9:52 UTC
Read the original article Hit count: 299

Filed under:
|
|
|

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

© Game Development or respective owner

Related posts about XNA

Related posts about c#