You are previewing Windows Phone 7 XNA Cookbook.
O'Reilly logo
Windows Phone 7 XNA Cookbook

Book Description

Over 70 recipes for making your own games with this Microsoft Windows Phone 7 XNA book .

  • Complete focus on the best Windows Phone 7 game development techniques using XNA 4.0

  • Easy to follow cookbook allowing you to dive in wherever you want.

  • Convert ideas into action using practical recipes

  • In Detail

    Developing games for Windows Phone 7, a new mobile platform, is your big chance to impact the world of mobile games. The XNA 4.0 for Windows Phone 7 integrates a lot of capabilities from software and hardware for you to create incredible games. The next generation of mobile games will be built by you.

    Windows Phone 7 XNA Cookbook is the best choice for you to make a game on Windows Phone 7. The book helps you to master the indispensable techniques to create your games using XNA 4.0. From the basics such as animating a 2D sprite and interacting with the customized graphical user interface to the more challenging such as 3D graphic rendering and collision detection.

    This comprehensive cookbook covers all the essential areas of XNA game development for Windows Phone 7, such as approaches to control the sensors, gestures and typical kinds of cameras. We also have recipes for sprite animation, texture rendering, and graphical user interface development that will give you a powerful tool to work with 2D effects. After this we move onto the more juicy stuff with recipes covering 3D graphic rendering and collision detection, and major ways to improve your loading efficiency. You will also work with Xbox live so you can take your game global. Finally, no mobile game development book would be complete without a look at performance optimization to make your games run faster. Windows Phone 7 XNA Cookbook will equip you with the firepower to rock the game world.

    Table of Contents

    1. Windows Phone 7 XNA Cookbook
      1. Windows Phone 7 XNA Cookbook
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      6. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      7. 1. Jump into Windows Phone Developer Tools and XNA Game Studio 4.0
        1. Introduction
        2. Installing Windows Phone Developer Tools
          1. How to do it...
        3. Creating your first Windows Phone XNA application
          1. How to do it...
          2. How it works...
        4. Deploying your game on an emulator or device
          1. Getting ready
          2. How to do it...
        5. Getting familiar with orientation
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Using DrawableComponent and GameServices
          1. Getting ready
          2. How to do it...
            1. How it works...
      8. 2. Playing with Windows Phone Touch and Sensors
        1. Introduction
        2. Creating your first touch application/game
          1. Getting ready
            1. The GetState() method
            2. The TryGetPreviousLocation() method
            3. The GetCapabilities() method
          2. How to do it...
          3. How it works...
        3. Taking your touch application to the next level
          1. How to do it...
          2. How it works...
        4. Creating a Touch Directional Pad (D-pad)
          1. How to do it...
          2. How it works...
        5. Dragging and swiping objects
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Controlling images with Multi-Touch control
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Using accelerometer to make a ball move on your phone
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 3. Coordinates and View Your First Step into XNA Game Development on Windows Phone 7
        1. Introduction
        2. Drawing the axes for a 2D game
          1. How to do it...
          2. How it works...
        3. Setting up the position, direction, and field of view of a fixed camera
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Drawing the axes for a 3D game
          1. How to do it...
          2. How it works...
        5. Implementing a first-person shooter (FPS) camera in your game
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Implementing a round rotating camera in a 3D game
          1. How to do it...
          2. How it works...
        7. Implementing a chase camera
          1. How to do it...
          2. How it works...
        8. Using culling to remove the unseen parts and texture mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
      10. 4. Heads Up Display (HUD) Your Phone Game User Interface
        1. Introduction
        2. Scaling an image
          1. How to do it...
          2. How it works...
        3. Creating a Simple Sprite Sheet animation in a 2D game
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Creating a Complex Sprite Sheet animation in a 2D game
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Creating a text animation in Adventure Genre (AVG) game
          1. How to do it...
          2. How it works...
        6. Creating a text-based menu the easiest menu to create
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Creating an image-based menu
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Creating a 3D model-based menu
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Creating a progress bar for game content loading and value status
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Creating buttons in your game
          1. How to do it...
          2. How it works...
        11. Creating a listbox to speed up your information management in a game
          1. Getting ready
          2. How to do it...
          3. How it works...
        12. Creating a text input control to communicate with others in a game
          1. How to do it...
          2. How it works...
      11. 5. Content Processing
        1. Introduction
        2. The architecture and flow of content processing
            1. The reading phase
            2. The loading phase
            3. Content Document Object Model
        3. Creating a custom importer and processor for your text
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Processing XML files
          1. How to do it...
          2. How it works...
        5. Manipulating the extracted information from an image in the content pipeline
          1. How to do it...
          2. How it works...
        6. Extracting BoundingSphere and BoundingBox information from models
          1. Getting ready
          2. How to do it...
            1. How it works...
      12. 6. Entering the Exciting World of 3D Models
        1. Introduction
        2. Controlling a model with the help of trackball rotation
          1. How to do it...
          2. How it works...
        3. Translating the model in world coordinates
          1. How to do it...
          2. How it works...
        4. Scaling a model
          1. How to do it...
          2. How it works...
        5. Viewing the model hierarchy information
          1. How to do it...
          2. How it works...
        6. Highlighting individual meshes of a model
          1. How to do it...
          2. How it works...
        7. Implementing a rigid model animation
          1. How to do it...
          2. How it works...
        8. Creating a terrain with texture mapping
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Customizing vertex formats
          1. How to do it...
          2. How it works...
        10. Calculating the normal vectors from a model vertex
          1. Getting ready
          2. How to do it...
            1. How it works...
        11. Simulating an ocean on your CPU
          1. How to do it...
          2. How it works...
      13. 7. Collision Detection
        1. Introduction
        2. Detecting the intersection of line segments
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Implementing per pixel collision detection in a 2D game
          1. How to do it...
          2. How it works...
        4. Implementing BoundingBox collision detection in a 3D game
          1. How to do it...
          2. How it works...
        5. Implementing BoundingSphere collision detection in a 3D game
          1. How to do it...
          2. How it works...
        6. Implementing ray-triangle collision detection
          1. Getting ready...
          2. How to do it...
          3. How it works...
        7. Mapping a tapped location to 3D
          1. How to do it...
          2. How it works...
        8. Implementing sphere-triangle collision detection
          1. How to do it...
          2. How it works...
        9. Making a 3D ball move along a curved surface
          1. How to do it...
          2. How it works...
      14. 8. Embedding Audio in your Game
        1. Introduction
        2. Controlling an audio file
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Adding sound effects to your game
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Adding stereo sounds to your game
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 9. Special Effects
        1. Introduction
        2. Using dual texture effects
          1. How to do it...
          2. How it works...
        3. Using environment map effects
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Rendering different parts of a character into textures using RenderTarget2D
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating a screen transition effect using RenderTarget2D
          1. How to do it...
          2. How it works...
      16. 10. Performance Optimization Fast! Faster!
        1. Introduction
        2. Optimizing your game's performance
          1. Getting ready
            1. Design versus implementation
            2. Game runs slow?
            3. Measuring the running time
          2. How to do it…
            1. How it works…
            2. There's more...
        3. Using the EQATEC Profiler to profile your game's running time
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Reducing the game contents' loading time
          1. Making good loading decisions
          2. Using the XNA content pipeline to reduce file size
          3. Evaluating the asynchronous background loading
          4. Considering the custom serialization
        5. Improving game performance with garbage collection
          1. Value types versus reference types
          2. Defining a true value checking method
          3. Using StringBuilder for string operations
          4. Drawing integer in string without garbage
          5. Taking advantage of the list for sprites
        6. Preferring struct rather than class when just an instance is needed
      17. 11. Launching to the Marketplace
        1. Introduction
        2. Preparing to submit your application to the Marketplace
        3. Application submission checklist
        4. Submitting your application to the Marketplace
          1. Getting ready
          2. How to do it…
          3. How it works…