Converting the Collision Game from Windows to Zune

This section will walk through the conversion of the Windows 2D game that you built in the previous chapters to a Zune version of the same game. Open the project from the previous chapter to get started.

To convert from one project type to another, you can right-click on the project name in Solution Explorer and select "Create Copy of Project for Zune." This will result in the creation of a copy of the project that references the same files but is ready to be compiled for and deployed on the Zune.

Make sure that your new Zune project is the startup project for your solution. While you can have multiple projects in a single solution (just like you do now—you have a Windows project and a Zune project in the same solution), you can only have one startup project. This is the project that will run when you run your game. To set the Zune project as your current project, right-click it in Solution Explorer and select "Set as StartUp Project."

In converting your Collision game to a Zune game, you'll obviously have to change two key components of the game: audio and input.

In terms of audio, you'll have to scrap all the XACT stuff and add the sound files into the project directly. Then, you'll have to use the SoundEffect class to play those sounds at the appropriate times.

You're limited in terms of what you can do with input, but luckily, the Collision game doesn't require any input other than moving in an X/Y plane, and the input that comes ...

Get Learning XNA 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.