Cameras


Handling the input and managing the game screens is important and you will look at a more professional game and a more complete looking game after you have implemented all the game screens, even if your background textures are still placeholders.

For the game itself, especially if it is in 3D and if you can move around freely in the game world, you need a camera class. Chapter 5 introduced the SimpleCamera class to move around and zoom in a simple 3D environment. More interesting and useful are the camera classes in the Rocket Commander game (SpaceCamera class) and the one in the racing game (ChaseCamera class). The camera required for XNA Shooter can be pretty simple; you can just reuse the SimpleCamera class and move the look at target position through the level.

Figure 10-10 shows a comparison of all camera classes used in this book. The SpaceCamera class is discussed here, and in a few chapters you are going to check out the ChaseCamera class too. Thanks to the GameComponent class the SimpleCamera is derived from you should be able to add new camera classes yourself with ease.

image from book
Figure 10-10




Professional XNA Game Programming
Professional XNA Programming: Building Games for Xbox 360 and Windows with XNA Game Studio 2.0
ISBN: 0470261285
EAN: 2147483647
Year: 2007
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net