Datasheet

Chapter 2 provides more detailed coverage of the steps required to get a game running on the Xbox 360,
but the sample in this chapter also works on the console out-of-the-box. Just start the project, switch to
the Xbox 360 output, and press F5. If you have set up everything correctly, you can see the same output
on the Xbox 360. Congratulations, you just started your first Xbox 360 game!
Last but not least, if you run into compiler errors from the code in this chapter, here are some final tips:
Make sure you have all required variables defined: graphics, content,
backgroundTexture,
sprites, and
scrollingPosition.
Read the compiler error message and change the code accordingly. Maybe you are trying to use
an obsolete method; either replace it with the new method or just comment it out to see how the
rest of the code behaves.
If the compiling works, but the program crashes or throws an exception, it is most likely that
you have some content file missing (the
CityGroundSmall.jpg texture in this project) or that
your graphic hardware does not support at least Shader Model 1.1.
Summary
This chapter covered a lot about the background of XNA and how to get XNA Game Studio Express
working on your PC, and even how to install XNA on your Xbox 360 if available. You also wrote your
first little project — I wouldn’t really call it a game, but it has a texture, the Xbox 360 controller input and
keyboard input is handled, and you have a response on the screen by scrolling the background texture
up and down.
The following chapters focus more on programming cool little games. Here’s a recap of what you have
learned so far:
Background of the XNA Framework
Installing XNA Game Studio Express
Tips and tricks on how to get XNA running on Visual Studio 2005
Additional tools that might be useful such as TestDriven.NET, SourceSafe, and Ants Profiler
Writing your first XNA project
Concept of the Application Model and the
Initialize, Update, and Draw methods
Clearing the background
Drawing a texture with help of a sprite batch
Handling gamepad and keyboard input
Drawing a tiled background based on your input
Changes in XNA 2.0
28
Part I: XNA Framework Basics
61286c01.qxd:WroxPro 1/21/08 3:44 PM Page 28