Professional XNA Programming: Building Games for Xbox 360 and Windows with Xna Game Studio 2. 0

( 1 )


This improved and updated edition of the bestseller will get you up and running quickly with building games for Xbox 360 and the Windows platform. Professional game developer and Microsoft MVP Benjamin Nitschke begins by explaining how to install the free XNA Game Studio 2.0 and then goes on to share essential advice for using it in a productive way.

Before you know it, each successive chapter will have you developing small games that increase in difficulty. By using the ...

See more details below
$36.03 price
(Save 9%)$39.99 List Price
Other sellers (Paperback)
  • All (28) from $1.99   
  • New (13) from $2.04   
  • Used (15) from $1.99   
Sending request ...


This improved and updated edition of the bestseller will get you up and running quickly with building games for Xbox 360 and the Windows platform. Professional game developer and Microsoft MVP Benjamin Nitschke begins by explaining how to install the free XNA Game Studio 2.0 and then goes on to share essential advice for using it in a productive way.

Before you know it, each successive chapter will have you developing small games that increase in difficulty. By using the chapters as building blocks, you'll evolve from 2D programming to 3D, and you'll ultimately create a full-blown graphics engine that can be used for more advanced game projects. Plus, you'll get an inside look at six fully functional games, including the popular Racing Game and the new Dungeon Quest.

What you will learn from this book

  • Tips for adding music and sound with XACT
  • Techniques for creating unique visual effects through Shaders
  • Ways to access keyboard, mouse, and Xbox controllers with XInput
  • How to write your own XNA graphics engine and create a game engine
  • How to manage content in XNA
  • Myriad ways of fine-tuning, debugging, and troubleshooting
  • How to make sure games run on the Xbox 360
  • Ways to generate landscapes and tracks
  • How to take advantage of XNA's new networking APIs

Who this book is for
This book is for anyone who wants to create games on the Xbox 360 and Windows platforms. Experience with C# or a similar .NET language is necessary, but previous game programming is not required.

Wrox Professional guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.

Read More Show Less

Product Details

  • ISBN-13: 9780470261286
  • Publisher: Wiley, John & Sons, Incorporated
  • Publication date: 2/26/2008
  • Edition number: 2
  • Pages: 600
  • Product dimensions: 7.40 (w) x 9.20 (h) x 1.25 (d)

Meet the Author

Benjamin Nitschke is the founder, lead programmer, and game designer at exDream entertainment. He is 26 years old, and lives in Hannover, Germany. He became a DirectX MVP of Microsoft in 2006 for his outstanding work in the DirectX community, especially with the free game Rocket Commander.
He started young — at the age of 9 he bought his first computer, a C64. He did not have many games, but he was very eager to type in commands on the C64, and from that to writing the first applications and games in Basic was not a big step. A few years later, he finally got a PC (386) and started some small game projects (Tetris clones, shoot-em-up games, and so on). exDream entertainment was founded 10 years ago, and it released a couple of smaller games before the first RTS game, Arena Wars, was created. Arena Wars was the first commercial .NET game ever and was released in 2004, where it received more than 20 awards worldwide, especially for the great multiplayer modes.
Recently, Benjamin has developed a couple of free open source games such as Rocket Commander and the XNA Racing Game Starter Kit, along with many game modifications. These games feature many video tutorials and a good documentation and code style to help beginners create their first video games. The video tutorials have been viewed more than 100,000 times and the games were downloaded and played even more often than that.

Read More Show Less

Table of Contents



Part I: XNA Framework Basics.

Chapter 1: Introducing XNA.

Introduction to the XNA Framework.

XNA Game Studio Express.

Application Model.

Content Pipeline.

Get the Free XNA Game Studio Express.



What About Visual Studio 2005 Professional?

Configuring Your Xbox 360.

Getting Started.

Your First Project.

F5 and Go.

Changing the Code.

Notes about XNA.

Important Links.

Is C# Good for Game Development?

Getting Used to the Content Pipeline.

Differences with MDX.

Additional Tools and Tips.

Changes in XNA 2.0.



Chapter 2: Creating Your First Game: Pong.

Game Ideas.

Write Down Your Ideas!

Agile Methodology.

Solving Initial Difficulties.

Creating Some Textures.

Let’s Write Pong.


Unit Testing in Games.

Adding the Ball and Paddles.

Handling Player Input.

Collision Testing.

Adding Sound.

How This Looks on the Xbox 360.

Challenge: Improve the Pong Game.



Chapter 3: Helper Classes.

Managing the Content Pipeline.

Supported File Formats.

Advantages and Disadvantages.

Handling Content Directories.

Importing and Accessing Content.

Logging Error Messages.

Unit Testing in XNA.

NUnit and TestDriven.Net.

Starting Unit Tests.

Golden Rules.

RandomHelper Class.

Generate Random Vectors.

StringHelper Class.

Extracting Filenames.

Writing Lists.

Other Helpers.

SpriteHelper Class.

EnumHelper Class.

ColorHelper Class.

The Breakout Game.

Unit Testing in Breakout.

Breakout Levels.

The Game Loop.

Drawing Breakout.

Collision Testing

Challenge: Improve the Breakout Game.


Chapter 4: Game Components.

The Game Class.

Game Component.

More Helper Classe.

TextureFont Class.

Input Class.

Sound Class.

Tetris, Tetris, Tetris!

Rendering the Background.

Handling the Grid.

Block Types.


Handling Input.


Challenge: Create the NextBlock Game Component.


Part II: Basic Graphics Engine.

Chapter 5: Writing Your Own XNA Graphics Engine.

What Should Your Engine Be Able to Do?

The Engine Unit Test.

3D Models.

Rendering of Textures.

Line Rendering.

3D Programming.

Model Unit Test.

Testing Other Models.

Plugging in More Game Components.

Simple Camera Class.

ScreenshotCapturer Class.

Making Sure Games Run on the Xbox 360.

Downloading the XNA Game Launcher.

Xbox 360 Setup and Deploying Games.

Console Debugging and Tools.

Challenge: Write a Game Component.


Chapter 6: Shader Management.

Shader Overview.


Shaders Everywhere in XNA.

Example Games.

Step-by-Step Shader Tutorial.

FX Composer.

FX File Layout.


Vertex Input Format.

Vertex Shader.

Pixel Shader.

Importing the Shader into Your Engine.

Compiling Shaders.

Using Parameters.

Vertex Formats.

Rendering with Shaders.

Testing the Shader.



Chapter 7: Realism Through Normal Mapping.

Adding Detail to Objects.


Asteroids! Wrong Game or What?

So How Do Shaders Work?

Vertex Shaders and Matrices.

Pixel Shader and Optimizations.

ShaderEffect Class.

TangentVertex Format.

Normal Mapping Unit Test.

Adding Tangent Data with a Custom Processor.

Final Asteroid Unit Test.

More Shaders.

Offset Mapping.

Glass Shader.

Reflection and Water.

Challenge: Add Parallax Mapping.


Chapter 8: Post-Screen Shaders and the Rocket Commander Game.

Handling Post-Screen Shaders.

Pre-Screen Sky Cube Mapping.

Writing a Simple Post-Screen Shader.


Implementing Post-Screen Shaders.

RenderToTexture Class.

PostScreenDarkenBorder Class.

Unit Test Result.

More Post-Screen Shaders.

Motion Blur.

Color Correction.

Menu Effects.

Rocket Commander Game.

Performance in XNA.

Moving from MDX to XNA.

Using Threads to Improve Performance.

Result and Screenshots.

Challenge: Write an Edge Detection Shader.


Part III: Improving Your Game Engine.

Chapter 9: Adding Sound with XACT.

No DirectSound.

Handling .wav Files.

Using XACT.

Creating Projects.

Creating Your Wave Bank.

Compressing Music Data.

Sound Banks.

Cue Variables.

Other Effects.

Changes in XNA 2.0.

Sound Class.

Rocket Motor Sound.

Whoosh, What Was That?

Menu Sounds.

Challenge: Create Your XACT Project.


Chapter 10: Player Input and the User Interface.

Input Class.

The Update Method in the Input Class.

Mouse Rectangles.

Entering Text in XNA.

Game Screens.

Help Screen.

In-Game User Interface.



Space Camera.

Challenge: Write a Free Camera Class.


Chapter 11: Creating XNA Shooter.

Putting It All Together.


User Interface.


3D Models.

Animated Textures.


Landscape Rendering.

Base Texture and Normal Map.

Height Map.

Adding Objects.

XNA Shooter Game.

Game Logic.

3D Effects.

Unit Class.

Projectile Class.

Item Class.

Final Screenshot.

Challenge: Write a Game with Your Engine.


Part IV: Writing a Racing Game.

Chapter 12: Generating Landscapes and Tracks.

Game Comparisons.

Gran Tourismo.

Need for Speed.


XNA Racing Game.

Landscape Rendering.



Optimizing Tips.


Unit Testing to the Rescue.

Interpolating Splines.

More Complex Tracks.

Importing the Track Data.

Generating Vertices from the Track Data.

Final Result.

Challenge: Create a New Unit Test Track.


Chapter 13: Physics.

Newton’s Laws of Motion.

Keep It Simple.


Physics Engines.

Ageia PhysX.




Implementing Physics.

Handling Loopings.

Spring Physics.

Collision Detection.


Car Collision.

Challenge: Figure Out the Road Collision.


Chapter 14: Fine-Tuning and “Modding” the Racing Game.

Game Concept.

Game Idea.

Additional Features.

Game Screens.

Splash Screen.

Main Menu.

Game Screen.


Final Unit Testing and Tweaking.

Tweaking the Track.

Shadow Mapping.

Final Testing on Windows.

Final Testing on the Xbox 360.

Additional Ideas.

More Cars.

Online Highscore List.

More Shaders and Effects.

More Game Modes.

Multiplayer Mode.

Challenge: Write Your Own Mod!

Example Game: Speedy Racer.


Part V: Writing Multiplayer Games.

Chapter 15: Multiplayer and Xbox Live.

What’s New in XNA 2.0.

Overview About Networking in XNA 2.0.

TCP Versus UDP.

Firewalls and Punching Through NATs.

Network Architecture.

Sending UDP Data.

Connecting Two Players.

Network Messages.

Server Game List.

Writing a Chat Application.

Game Screens.

Handling Chat Messages.

The Final Chat Application.

Challenge: Write a Multiplayer Application.


Chapter 16: Role-Playing Games.

Types of Role-Playing Games.

“Hack and Slash” Role-Playing Games.

Massively Multiplayer Role-Playing Games.

Designing Dungeon Quest.






Weapons and Items.

Abilities and Spells.



Leveling System.

Challenge: Improve the Leveling System.


Chapter 17: Dungeon Quest.

Creating the Engine.

Changes to the Graphic Engine.

Using Collada Model Files.

Handling Many Point Lights.

Adding AI.


Alert-System via Cries.

Multiplayer Support.

Network Messages.

Xbox LIVE Support.

The Dungeon Quest Editor.


Appendix A: Resources.


Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Posted December 23, 2008

    I Also Recommend:

    Great course in game programming with XNA

    The book is well organized, using many examples with additional sources available from I am new to C#, but well-experienced in C++ and Java. This book avoids focusing on language differences and sticks to the original purpose of familiarization with XNA API's and sound game logic.<BR/><BR/>It has plenty of examples that are thoroughly explained and does not burden the reader by interlacing reference material in the content. This is not a reference book. It is a cover-to-cover lesson book that is easy to follow and gradually increases in intensity by chapter. The reader is immersed in full-blown 2D game examples as early as the second and third chapters. Follow the examples, attempt the suggested manipulations as well as some of your own, compare and contrast your version with the author's sources from his website, invest a little creativity, and this book gives you a jump-start in writing game engines using an iterative process.<BR/><BR/>I would recommend "Professional XNA Programming" to intermediate-level programmers as opposed to beginners. The author does not waste your time holding your hand through rudimentary language syntax, and if you are familiar with C++ or Java the examples fill in most blanks you'll need for C# in this context.<BR/><BR/>I am also recommending "Professional C# 2008" as a reference for those who feel less comfortable with the language. It is helpful to be familiar with the .NET Framework at an entry level before beginning XNA.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)