logo.jpg (7978 bytes)

OO Game Programming tutorial - Part 12



Nearly done!

Okay this is the home stretch. You will have a complete game after this!

There are a few loose ends that need to be tidied up.

First, we'll display the player's score in the top corners, a few lines in the text output section of Game_Main() and we're in buisness.

We will also check if the GAMEOVER condition occurs. When either of the player's score 7 points we'll end it.

Then, we'll make the game state start with GAMEOVER when we initialize the game and display "GAME OVER" the same as was done for "GET READY!".

Also we'll allow a new game to be started when we are in the GAMEOVER state and the space bar is pressed. We need to reset the player scores here, and change the game state to GETREADY.

Letting the players know the keys is a good idea when the game is in GAMEOVER state.

Project: Pong12.zip

 

Next page

Back to main page