Essential XNA Game Studio 2.0 Programming

Book description

Essential XNA Game Studio 2.0 Programming provides both hobbyists and experienced programmers with the information they need to take advantage of Microsoft’s powerful XNA Framework and XNA Game Studio to produce professional-level games for both the PC and the Xbox 360. Beginners learn the fundamentals of 2D game development, creating a complete top-down shooter. Intermediate and advanced users can jump right into 3D game development and create a version of the 3D game that takes advantage of hardware acceleration using High-Level Shader Language (HLSL).
Learn how to build an input system to receive events from devices; use the Microsoft Cross-Platform Audio Creation Tool (XACT) to integrate sounds and music into your game; design difficulty systems to tailor your game to players with different skill levels; create a multiplayer game using the networking features of the XNA Framework; implement an achievement system to provide incentive for continued play of your game.

Table of contents

  1. Cover
  2. Title page
  3. Copyright page
  4. Contents (1/2)
  5. Contents (2/2)
  6. About the authors
  7. Introduction
  8. Chapter 1: Framework XNA and Game Studio
    1. What Is XNA?
    2. What Is the XNA Framework?
      1. Game Assembly
        1. Game Class
        2. GameComponent/DrawableGameComponent Class
        3. GameServiceContainer Class
        4. GameTime Class
        5. GameWindow Class
        6. GraphicsDeviceManager
        7. Framework Namespace Interfaces
          1. IDrawable
          2. IGameComponent
          3. IGraphicsDeviceManager
      2. Pipeline Assembly
      3. Framework Assembly (1/2)
      4. Framework Assembly (2/2)
    3. What Is XNA Game Studio?
    4. Installing XNA Game Studio
    5. Project Types
      1. Windows Game
      2. Windows Game Library
      3. Xbox 360 Game
      4. Xbox 360 Game Library
    6. Starter Kits
      1. Spacewar
      2. Marblets
      3. Racing Game
      4. Ship Game
    7. Content Pipeline Overview
    8. Summary
  9. Chapter 2: Game Development Overview
    1. Parts of a Game
      1. Graphics
      2. Input Device(s)
      3. Networking
      4. AI
      5. GUI/User Interface
      6. Physics System
      7. Sound/Music
    2. Game States
    3. The Game Loop — XNA Style
    4. Calculating Frame Rate
    5. Game Components
    6. Game Services
    7. Creating Your First Application (1/3)
    8. Creating Your First Application (2/3)
    9. Creating Your First Application (3/3)
  10. Chapter 3: 2D Graphics
    1. Texture2D
    2. SpriteBatch
      1. Rotation
      2. Scaling
      3. Flipping
      4. Transparency
      5. Coloring
      6. Tiling
    3. Animating Sprites
    4. Multiple Batch Rendering
    5. Text Drawing
    6. Rendering with Multiple Viewports
    7. 2D Shooter Game Version 1
      1. Player and Enemy Sprites (1/2)
      2. Player and Enemy Sprites (2/2)
      3. Showing the Score, Frame Rate, and Countdown
    8. Summary
  11. Chapter 4: Input
    1. Gamepad, Keyboard, and Mouse Classes
      1. Gamepad
      2. Keyboard
      3. Mouse
    2. State Classes
      1. GamePadState
      2. KeyboardState
      3. MouseState
    3. Controlling Sprite Movement
    4. Collision Detection
      1. Rectangle Collision Detection (1/2)
      2. Rectangle Collision Detection (2/2)
      3. Per-pixel Collision Detection
      4. Transformed Sprite Collision Detection (1/2)
      5. Transformed Sprite Collision Detection (2/2)
    5. Creating a Configurable Control System (1/2)
    6. Creating a Configurable Control System (2/2)
    7. 2D Shooter Game Version 2 (1/3)
    8. 2D Shooter Game Version 2 (2/3)
    9. 2D Shooter Game Version 2 (3/3)
      1. Running and Gunning (1/6)
      2. Running and Gunning (2/6)
      3. Running and Gunning (3/6)
      4. Running and Gunning (4/6)
      5. Running and Gunning (5/6)
      6. Running and Gunning (6/6)
      7. Setting Up User-Configurable Controls (1/2)
      8. Setting Up User-Configurable Controls (2/2)
  12. Chapter 5: Sound
    1. XACT and Sound Creation
    2. Playing 2D Sound
    3. Playing 3D Sound
    4. 2D Shooter Game Version 3
      1. Adding Music and Sound
    5. Summary
  13. Chapter 6: I/O
    1. The StorageDevice and StorageContainer Classes
    2. Standard I/O Files and Operations
    3. Data Serialization
    4. 2D Shooter Game Version 4 (1/2)
    5. 2D Shooter Game Version 4 (2/2)
  14. Chapter 7: Basic Effects
    1. BasicEffect Class Methods
    2. Colors, Textures, and Alpha
      1. Implementing Textured Models
    3. Fog in XNA
      1. Implementing Fog
    4. Lighting
      1. Emissive and Ambient Light
      2. Diffuse Light
      3. Specular Light
      4. Implementing Lighting
    5. Additional Basic Effect Information
    6. Summary
  15. Chapter 8: 3D Math Basics
    1. Vectors
      1. Vector Arithmetic
      2. Clamping with Vectors
      3. The Cross Product
      4. Distance between Vectors
      5. The Dot Product
      6. The Length of a Vector
      7. Interpolating Vectors
      8. Finding the Minimum and Maximum Vector
      9. Negating Vectors
      10. Normalizing Vectors
      11. Reflecting Vectors
      12. Smooth Interpolation
      13. Vector/Matrix Transformation
      14. Additional Vector Operations
    2. Matrices
      1. Matrix Operations (1/2)
      2. Matrix Operations (2/2)
    3. Quaternion Rotations
      1. Quaternion Fields, Properties, and Functions
    4. Rays
      1. Ray Properties and Operations
    5. Planes
      1. Plane Properties and Operations
    6. Bounding Geometry
      1. Bounding Spheres, Boxes, and Frustums
    7. Summary
  16. Chapter 9: 3D Graphics
    1. Primitives
      1. Points
      2. Lines
      3. Triangles
      4. Indexed Geometry
    2. Models and Meshes
      1. XSI and XNA
      2. Loading and Rendering Models
      3. 3D Models Implementation
    3. Virtual Cameras
      1. 3D Camera Implementation (1/2)
      2. 3D Camera Implementation (2/2)
    4. Animations
      1. Straight-Path Animation Implementation
      2. Skeleton Animation (1/2)
      3. Skeleton Animation (2/2)
    5. 3D Shooter Game Version 1
      1. Game and Menu Screens
      2. The Player and Camera (1/2)
      3. The Player and Camera (2/2)
      4. Loading the Level and the Game (1/3)
      5. Loading the Level and the Game (2/3)
      6. Loading the Level and the Game (3/3)
    6. Summary
  17. Chapter 10: Importers/Converters
    1. Standard Importers and Content Processors
      1. Autodesk FBX (.fbx) Importer
      2. Effect (.fx) Importer and Processor
      3. Model Processor
      4. No Processing Required
      5. Sprite Font Descriptor Importer and Processors
      6. Texture Importer and Processor
      7. X File Importer
      8. XACT Importer and Processor
      9. XML Importer
    2. Extending the Standard Content Processing
      1. A Simple Example of Extending a Standard Processor
    3. Writing a Custom Importer and Processor
      1. Creating the Importer’s Project
      2. Storing Imported and Compiled Data
      3. Creating the Importer
      4. Creating the Processor
      5. Creating the Content Writer
      6. Creating the Content Reader
      7. Testing the Custom Importer in an Application
    4. 3D Shooter Game Version 2
      1. Game Enemies
      2. Version 2 of the Game (1/3)
      3. Version 2 of the Game (2/3)
      4. Version 2 of the Game (3/3)
      5. Adding Custom Content
    5. Summary
  18. Chapter 11: Shaders and Effects Custom
    1. Shader Models
      1. Shader Model 1.0
      2. Shader Model 2.0
      3. Shader Model 3.0
      4. Shader Model 4.0
    2. Vertex and Pixel Shaders
      1. Vertex Shaders
      2. Pixel Shaders
      3. Geometry Shaders
    3. An Overview of the High-Level Shading Language (HLSL)
      1. Data Types and Swizzling
      2. Semantics
      3. Techniques and Passes
    4. Simple Shader Demo (1/2)
    5. Simple Shader Demo (2/2)
    6. Summary
  19. Chapter 12: Game Distribution, the Creators Club, and the Xbox 360
    1. Sharing Your Games
    2. Joining the Creators Club
    3. Setting Up Your PC and Xbox 360 for XNA Games
    4. Programming Considerations for the Xbox 360
      1. Safe Regions
      2. Aspect Ratio
      3. Graphics, Input, Audio, and Storage Differences between Platforms
        1. Graphics
          1. Multisampling
          2. Shader Versions
          3. TextureUsage Flags
          4. Dynamic Vertex Buffers
        2. Input
        3. Audio
        4. Storage
    5. Setting Up Code for Cross-Platform Sharing
    6. Debugging
    7. XNA Framework Remote Performance Monitor
  20. Chapter 13: Creating a Difficulty System
    1. Types of Difficulty Systems
    2. Determining Our Difficulty Settings
    3. Determining Levels of Difficulty
    4. Storing Difficulty Settings
    5. Implementing the Difficulty System
    6. Testing the Difficulty System
    7. Moving On…
  21. Chapter 14: Networking
    1. Networking Models
      1. Peer-to-Peer
      2. Client/Server
    2. Networking Topologies
      1. Bus Topology
      2. Star Topology
      3. Ring Topology
      4. Mesh Topology
      5. Hybrid Topology
    3. Preparing the Game for Networking
      1. Gamer Services (1/2)
      2. Gamer Services (2/2)
    4. Implementing Networking in Ghost Arena 3D
      1. Changes to the Game Screens
      2. Changes to the Player and Ghost Classes
      3. Creating a Networking Session
      4. Hosting and Joining Games
      5. The Game Lobby (1/2)
      6. The Game Lobby (2/2)
    5. Adding Networking to the Game
      1. New Variables and Objects
      2. Updated Initialization Functions
      3. Updated Game Over
      4. Updated Draw and Update Functions (1/2)
      5. Updated Draw and Update Functions (2/2)
      6. Updated Firing
    6. Future Improvements
    7. Summary
  22. Chapter 15: Creating an Achievement System
    1. Our Achievements
    2. The Achievement Class (1/2)
    3. The Achievement Class (2/2)
    4. Capturing Achievements (1/2)
    5. Capturing Achievements (2/2)
    6. Sharing Achievements
    7. Summary
  23. Appendix: Additional Resources
  24. Index (1/2)
  25. Index (2/2)

Product information

  • Title: Essential XNA Game Studio 2.0 Programming
  • Author(s): Jim Perry, Allen Sherrod
  • Release date: October 2010
  • Publisher(s): Jones & Bartlett Learning
  • ISBN: 9781449612894