The Microsoft XNA Framework provides a powerful set of tools to allow development teams of any size, from the individual developer to larger independent teams, to rapidly develop high performance quality games for multiple Microsoft-related platforms.
This book will present a series of video games, utilizing XNA Game Studio and the XNA Framework to delve into the world of 2D game development targeting the Microsoft Windows environment. We will utilize XNA's 2D graphics capabilities to present our games to the player, and look at the fundamental systems behind several game design challenges, such as path-finding, collision detection, special effects, and more.
Each of the four games in this book cover a new gaming style, and introduce progressively more advanced techniques and systems to provide a foundation for bringing your own creations to life.
Chapter 1, Introducing XNA Game Studio begins by looking at the history of the XNA Framework and its predecessors, and installing the Windows Phone Development Tools package that includes the version 4.0 release of the XNA tools. We wrap up this chapter by looking at the building blocks of an XNA game and putting together an XNA mini-game called SquareChase.
Chapter 2, Flood Control – Underwater Puzzling introduces a board-based puzzle game called Flood Control. We introduce the XNA Content Pipeline, and build a recursive function to determine the state of the game board while playing.
Chapter 3, Flood Control – Smoothing out the Rough Edges refines and completes the Flood Control game, adding animated rotation, movement, and fading of game pieces. We will implement a scoring system and cover displaying text to the screen.
Chapter 4, Asteroid Belt Assault – Lost in Space begins developing our second game. This time we put together a space-based shooter. We will create a basic moving star field using a simple particle system, and introduce frame-based sprite animation. We will add moving asteroids to our star field and examine how to detect collisions between asteroids and make them respond realistically. We add a player-controlled spaceship, and enemies that can fly across the screen following pre-defined waypoints.
Chapter 5, Asteroid Belt Assault – Special Effects wraps up Asteroid Belt Assault. We implement collision detection between the player, enemies, asteroids, and bullets and create particle-based explosions. Finally, we will look at loading and playing sound effects to bring life to our in-game events.
Chapter 6, Robot Rampage – Multi-Axis Mayhem begins the construction of a tank-based game in which the player can move and fire independently using either an Xbox 360 controller or the keyboard. We build a tile-map based game world and a camera class to view a screen-sized area of the larger world, and implement player collision with the walls of the tile map.
Chapter 7, Robot Rampage – Lots and Lots of Bullets completes Robot Rampage by expanding on our particle-based explosion system, and adding enemies, player goals, and weapon upgrades to our tile map. We allow the player to fire at the enemies with several different weapons. Finally, we create an implementation of the A* path-finding algorithm to allow the enemy tanks to track down the player.
Chapter 8, Gemstone Hunter – Put on your Platform Shoes introduces a side-scrolling, jump-and-run platform game. We start by evolving our tile-based mapping system to allow multiple layers of tiles, and look at combining XNA and Windows Forms to produce a map editor for Gemstone Hunter. As part of this process, we will look at building more complex solutions that contain multiple projects, and separate our game's tile engine into a Game Library project.
Chapter 9, Gemstone Hunter – Standing on Your Own Two Pixels concludes the Gemstone Hunter project by examining an alternative method for frame-based sprite animation using player and enemy graphics from the XNA Platform Starter Kit. We implement platform physics and bring the game together by loading levels and reacting to their embedded code values.