Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
What You’ll Learn in This Hour:
• Limitations of global variables
• Drawing a lot of sprites
This hour continues to explore the capabilities of XNA’s bitmap drawing features via the SpriteBatch class. As we learned in the preceding hour, bitmaps are the building blocks of most 2D and 3D games. Although a game could be designed using just 2D vectors or 3D wireframes—perhaps in a retro style as a homage to such games of the 1970s when graphics hardware was not yet able to rasterize bitmaps—there is little reason to use lines today in a properly designed game. Bitmaps are the name of the game today, for both 2D and 3D games. A bitmap-based 2D game will have small “flat” game characters, vehicles, or avatars to represent the gameplay, whereas a mesh- and matrix-based 3D game will have rendered objects in the game with such effects as real-time lighting and realistic surfaces with reflection and textured bumpiness.