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

Similar book on Amazon
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
XNA Game Studio 4.0 Programming: Developing for Windows Phone 7 and Xbox 360 (Developer's Library)
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Learning XNA 3.0: XNA 3.0 Game Development for the PC, Xbox 360, and Zune
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Beginning XNA 2.0 Game Programming: From Novice to Professional (Expert's Voice in Game Programming)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)
Microsoftu00ae XNAu00ae Game Studio 3.0: Learn Programming Now! (Pro - Developer)

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