XNA Speed Pool


The objective of Speed Pool is to pot all the balls in the fastest possible time.

This time taken to pot the balls can be used to quantify how well the player has performed. Therefore, this value can be used by the player to measure their improvement or compare with other players.

So what steps do we need to take to get this simple game up and running?

You can add these in any order you like (I’ve tried to order them in terms of difficulty – easiest to hardest):

Record the time

You’ll need to add a variable to hold the time as it increments. You should be able to find the change in time in the Update() method.

Count the number of balls on the table

We need to be aware of how many balls have been potted and hence when the clock should be stopped

Display the time

The user must be kept informed of their progress. It will encourage the play to be more frantic.
To add this is a bit more work – I’m going to leave this with you to investigate. There is a good example of displaying a score on the screen in the XNA example SpaceWar game.

Add a visual representation of the cue

As we’ve said before, a game is a lot about feedback to the user – for example the player needs to be aware of where the cue is and therefore in which direction the ball will travel. A cue image has been provided.

Extra: Look at adding additional rules, e.g. Ensure the black is potted as the final ball or a penalty for potting the white.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.