O'Reilly logo

Learning XNA 4.0 by Aaron Reed

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

Chapter 8: Putting It All Together

Quiz Answers

  1. What type of object is used to draw 2D text in XNA?

    You need a SpriteFont object to draw 2D text in XNA.

  2. How is a background image different from an image used to represent a player or object in the game?

    It really isn’t any different. The underlying concept is exactly the same: you’re drawing a 2D image on the game window. The background image in this case doesn’t animate, and the file containing the background image contains only that image (in contrast to the player sprites, which are animated; the files used for those objects contain sprite sheets with multiple images forming an animation sequence).

  3. What are game states and how are they used?

    Game states represent a way to indicate the current status of the game as a whole or some activity within the game. Game states are used to transition from splash screens to gameplay, from gameplay to end-game screens, and so on.

  4. In the Flight of the Conchords episode “Mugged,” what do the muggers steal from Jemaine?

    The muggers steal Jemaine’s camera-phone—which was actually a gift to him from Bret and is also really just Jemaine’s phone glued to a camera.

Exercise Answer

Change the behavior of the skull power-up (or power-down, if you prefer) to freeze the player for 2 seconds rather than reduce the player’s speed by 50% for 5 seconds. Use different power-up timers for the skull, bolt, and plus sprites.

There really isn’t anything too complicated involved in adding a new power-up (or power-down), now ...

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