Challenge: Improve the Pong Game


It is now your turn to improve the game a little bit; maybe you can exchange the graphics or sounds or you can adjust the game play. Also try to add Rumble support for your Gamepad controller if you have one. You really should have one if you read this book, even if you don’t have an Xbox 360; a lot of XNA samples will require an Xbox 360 controller and some of the games are more fun with an Xbox 360 controller than having to play with the keyboard.

Here is the method to add Rumble support for a specific gamepad:

  GamePad.SetVibration(PlayerIndex.One, leftRumble, rightRumble); 

Use that code to rumble a bit for a short while if the ball hits your paddle (use the same value for left and right rumble, then the whole controller just shakes). And also rumble if you lost a life, this time longer and stronger.

As always you can check out the project for this chapter and see a solution to the challenge. Your solution does not have to be the same, but it might be useful to see another or maybe even an easier way to solve a specific problem.

Have fun with XNA Pong.




Professional XNA Game Programming
Professional XNA Programming: Building Games for Xbox 360 and Windows with XNA Game Studio 2.0
ISBN: 0470261285
EAN: 2147483647
Year: 2007
Pages: 138

Similar book on Amazon
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net