O'Reilly logo

Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® by Robert Fonseca-Ensor, Karli Watson, Nick Lecrenski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AN XNA GAME: TANK

In this chapter, you'll create a simple but functional game with XNA. This game is creatively named Tank, as it puts the player in charge of a vehicle that he or she can drive across the screen with his or her thumb. In the game, a missile can be launched at the tank from the corners of the screen. These missiles home in on the tank, but the player can shoot them down (see Figure 11-1).

If you follow all the steps in this chapter, you'll create the Tank game shown in Figure 11-1. The following Try It Out walks you through how to start this new XNA project.

FIGURE 11-1: The finished Tank game, running in the emulator.

image

TRY IT OUT Creating the Windows Phone Tank Game

Following are the first steps for creating the Tank Windows Phone game using XNA:

  1. In Visual Studio, choose File image New Project.
  2. From the left side of the New Project dialog, select XNA Game Studio 4.0.
  3. Select the Windows Phone Game template option and type the name of the project, Tank, in the Name field (see Figure 11-2).

    FIGURE 11-2: The New Project dialog.

    image

  4. Click OK. Visual Studio creates a number of files for you, and you can see them in the Solution Explorer (see Figure 11-3).

FIGURE 11-3: A fresh XNA ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required