SUMMARY

In this chapter, you've seen how to build a simple 2-D game with XNA. The chapter started by covering the basic game loop of an XNA game and its performance implications. You now have an idea of what kinds of programs suit XNA versus Silverlight, the two platforms available to develop with Windows Phone 7.

You looked at how to draw images and text to a phone's screen within an XNA game loop, and then you learned how to update the game's state within the same life cycle by reading touch input from the user and understanding the vital Vector2 class.

You moved on to how to make it easier to build big, complex games with the help of GameComponent objects, and you applied these techniques to the Tank game that you built in this chapter.

Finally, you read about some different techniques that may be useful when creating an XNA game, and you used each of these techniques to complete more features of the Tank game.

In the next chapter, you'll learn more about Silverlight and how to use Expression Blend to easily create complex visuals and animations.

EXERCISES

  1. How would you animate the flame that's drawn at the back of the missile sprite to make it look more realistic?
  2. How could you make “powerups” (for example, things that make the tank move faster or fire faster) appear randomly on the screen? How would you make it so that the tank could pick them up? How would you apply these powerups to the tank?
  3. How would you create different screens for your game, so that it launched with ...

Get Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® 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.