You have now read everything you need to know to get started with your first XNA project. If you just read through this chapter, I highly recommend you at least open up the project for this chapter (download it from www.wiley.com) and run it.
If you run into problems installing DirectX, .NET 2.0, or XNA, try to search for help on the XNA Forums - http://msdn.microsoft.com/xna/forums. It is hard to give tips in the form of a book because of the many errors that can happen. Generally, make sure you meet the minimum requirements. For example, if you try to install on an unsupported platform and it does not work out, try to find help on that issue on the Internet or switch to a supported platform.
For .NET 2.0 it is important that you have the most recent service pack for your operating system. For DirectX make sure you have the most recent graphics driver and a decent graphic card to even work on 3D graphics, and finally for XNA, make sure you have everything correctly installed before starting the XNA setup.
Getting XNA to work on Windows isn’t very hard. On the Xbox 360 a lot of things go can go wrong. Here are a couple of tips to make sure you meet the requirements for running XNA games on your 360:
You need an Xbox 360 Live Account on your Xbox 360, which must be connected at all times when you develop and test your XNA games.
Make sure your PC and the Xbox 360 are on the same network and they can “see” each other. You can test ping-ing the Xbox 360 IP from your PC or connecting to your PC as a media center from the Xbox 360.
If the Xbox 360 XNA Framework could not be installed, search for more help on the Internet to see if your Xbox 360 meets the minimum requirements (you need a hard disk, for example).
When you create an encryption key in Settings of the XNA Game Launcher and it is not accepted by your PC because you maybe mistyped it or it contained 0 (the number zero) and O letters, which almost look the same, just try it again; you can always create a new encryption key. See earlier in the chapter for details.
If the XNA Game Launcher does not start or all buttons are grayed out or if you receive some error like 0xffffffff, it means that your profile is not connected to Xbox Live or it has some wrong settings. If you had an older version of the XNA Framework installed before, uninstall it, delete your profile, and create a new profile and reinstall the XNA Framework again.
Chapter 2 talks in greater detail about every single step required to get a game running on the Xbox 360, but the sample of this chapter does also work 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 some 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.