XNA GameStudio 2.0
Taking The Idea Further

Beginners - Change Game Assets

An easy way to change the game for someone who doesn't have much experience of programming is to swap the game assets for your own.

The pitch is a good place to start - but all of the graphics could do with some work. Think about the dimensions of the graphics you use.

You could also swap the sounds,

Beginners+ - Add Game Pad Functionality

Our code for managing keyboard input is all contained in the HandleInput() method of the main class. We used the KeyboardState object to find out which keys were being pressed. There is also a built-in object called GamePadState. Study the following code snippet carefully - it shows how to find out if buttons are pressed on the game pad.

GamePadState currentGamePadState = GamePad.GetState(PlayerIndex.One);
if (currentGamePadState.Buttons.A == ButtonState.Pressed)
   // A button pressed
if (currentGamePadState.DPad.Left == ButtonState.Pressed)
    // Left DPad pressed
if (currentGamePadState.DPad.Right == ButtonState.Pressed)
    // Right DPad pressed

You need to replace the lines which begin with // with code that responds to the player's input.

Beginners+ - Change The Game Rules

The rules of this game are contained within the code that we wrote. By changing some of the figures, we can affect the way that the game behaves. For example, you could make it so that a player can move their bat off the top of the screen and make it appear at the bottom. You could increase or decrease the speed of bats and balls, change the number of goals required for a win and so much more.

More Advanced - Add Game Objects

If you know your way around C#, the world is your lobster. Take this game as an opportunity to see what you can do with the framework. Use the help system if necessary and try to implement some new functionality. It is relatively straightforward to work out how to increase and decrease the size of the bats during the game. Some power-ups and power-downs might add to the game.

Advanced - Add AI

The challenge for the C# experts is to program a computer player. The computer player should behave something like a human player - you need to think carefully about how humans apply basic strategy to this type of game.