| Contents at a Glance | 4 |
---|
| Contents | 5 |
---|
| Foreword | 12 |
---|
| About the Authors | 13 |
---|
| About the Technical Reviewer | 15 |
---|
| Acknowledgments | 16 |
---|
| Introduction | 17 |
---|
| Who This Book Is For | 18 |
| How This Book Is Structured | 18 |
| Prerequisites | 19 |
| Book Code and Errata | 20 |
| Contacting the Authors | 20 |
| Chapter 1 Game Planning and Programming Basics | 21 |
---|
| Planning the Game | 21 |
| XNA Game Programming Concepts | 25 |
| Summary | 33 |
| Chapter 2 2D Graphics, Audio, and Input Basics | 35 |
---|
| 2D Graphics | 35 |
| Game Input | 49 |
| Game Audio | 52 |
| Summary | 57 |
| Chapter 3 Creating Your First 2D Game | 59 |
---|
| Design for the First Game: Rock Rain | 59 |
| Let s Get to It | 60 |
| An Xbox 360 Version of Rock Rain | 77 |
| Summary | 79 |
| Chapter 4 Improving Your First 2D Game | 80 |
---|
| Planning Rock Rain s New Version | 80 |
| Creating the Game Screens | 80 |
| Navigating Between the Scenes | 129 |
| Summary | 134 |
| Chapter 5 Basics of Game Networking | 135 |
---|
| Introducing Multiplayer Games | 135 |
| Introducing XNA Networking | 144 |
| Summary | 167 |
| Chapter 6 Rock Rain Live! | 169 |
---|
| Planning Rock Rain Live | 169 |
| Adding the Support for Network Games | 170 |
| Changing the Opening Screen | 171 |
| Creating the Network Game Scene | 173 |
| Creating the Game Sessions | 184 |
| Let s Talk | 188 |
| Synchronizing the Players | 193 |
| Summary | 200 |
| Chapter 7 Rock Rain Zune | 201 |
---|
| Planning Rock Rain Zune | 201 |
| Organizing the Game | 202 |
| Modifying the Classes | 204 |
| Deploying the Game on the Zune | 214 |
| Summary | 216 |
| Chapter 8 3D Game Programming Basics | 217 |
---|
| 3D Coordinate Systems and Projections | 217 |
| Vertices and Primitives | 219 |
| Vectors, Matrices, and 3D Transformations | 223 |
| Lights, Camera . . . Effects! | 227 |
| Drawing the 3D Axis in XNA | 228 |
| Models and Meshes | 238 |
| Summary | 242 |
| Chapter 9 Rendering Pipeline, Shaders, and Effects | 244 |
---|
| Rendering Pipeline | 244 |
| Shaders | 245 |
| High-Level Shading Language | 247 |
| Techniques, Passes, and Effects | 252 |
| Shader Authoring Tools | 257 |
| Summary | 257 |
| Chapter 10 Lights, Camera, Transformations! | 258 |
---|
| Cameras | 258 |
| Lights | 270 |
| Camera and Light Managers | 271 |
| Object Transformation | 274 |
| Summary | 276 |
| Chapter 11 Generating a Terrain | 277 |
---|
| Height Maps | 277 |
| Creating the Terrain Class | 280 |
| An Overview of Terrain Techniques | 291 |
| Creating the Terrain Effect | 293 |
| Drawing the Terrain | 304 |
| Extending the Terrain Effect with Normal Mapping | 305 |
| Querying the Terrain s Height | 307 |
| Ray and Terrain Collision | 310 |
| Summary | 313 |
| Chapter 12 Skeletal Animation | 314 |
---|
| Types of Animations | 314 |
| Skeleton and Bone Representation | 317 |
| Extending the Content Pipeline for Model Animation | 319 |
| Using the AnimatedModel Class in XNA | 334 |
| Summary | 351 |
| Chapter 13 Creating a Third-Person Shooter Game | 352 |
---|
| Designing the Game | 352 |
| Starting the Game Engine | 354 |
| Creating Helper Classes | 358 |
| Creating the Game Logic | 366 |
| Finishing the Game Engine | 394 |
| Summary | 409 |
| Chapter 14 Closing Words | 410 |
---|
| Where You Are Now | 410 |
| Where Do You Go from Here? | 411 |
| Create Your Own Game | 412 |
| Index | 414 |