Synopses & Reviews
Now you can build your own games for your Xbox 360, Windows Phone 7, or Windows-based PC—as you learn the underlying concepts for computer programming. Use this hands-on guide to dive straight into your first project—adding new tools and tricks to your arsenal as you go. No experience required!
- Learn XNA and C# fundamentals—and increase the challenge with each chapter
- Write code to create and control game behavior
- Build your game’s display—from graphics and text to lighting and 3-D effects
- Capture and cue sounds
- Process input from keyboards and gamepads
- Create features for one or multiple players
- Tweak existing games—and invent totally new ones
About the Author
Rob Miles has been teaching computer programming for more than 25 years. An expert on Visual C#(R) and a Microsoft MVP for Device Application Development, Rob enjoys inspiring new and experienced programmers. As well as writing his own games, programs, and poetry, Rob has consulted on a wide range of commercial software projects.
Table of Contents
; Acknowledgments; Introduction; Who This Book Is For; System Requirements; Code Samples; Errata and Book Support; We Want to Hear from You; Stay in Touch; Getting Started; Chapter 1: Computers, C#, XNA, and You; 1.1 Introduction; 1.2 How the Book Works; 1.3 C# and XNA; 1.4 Getting Started; 1.5 Writing Your First Program; 1.6 Conclusion; 1.7 Chapter Review Questions; Chapter 2: Programs, Data, and Pretty Colors; 2.1 Introduction; 2.2 Making a Game Program; 2.3 Working with Colors; 2.4 Controlling Color; 2.5 Conclusion; 2.6 Chapter Review Questions; Chapter 3: Getting Player Input; 3.1 Introduction; 3.2 Reading a Gamepad; 3.3 Using the Keyboard; 3.4 Adding Vibration; 3.5 Program Bugs; 3.6 Conclusion; 3.7 Chapter Review Questions; Images, Sound, and Text; Chapter 4: Displaying Images; 4.1 Introduction; 4.2 Resources and Content; 4.3 Using Resources in a Game; 4.4 Conclusion; 4.5 Chapter Review Questions; Chapter 5: Writing Text; 5.1 Introduction; 5.2 Text and Computers; 5.3 Getting the Date and Time; 5.4 Making a Prettier Clock with 3-D Text; 5.5 Creating Fake 3-D; 5.6 Conclusion; 5.7 Chapter Review Questions; Chapter 6: Creating a Multi-Player Game; 6.1 Introduction; 6.2 Conclusion; 6.3 Chapter Review Questions; Chapter 7: Playing Sounds; 7.1 Adding Sound; 7.2 Conclusion; 7.3 Chapter Review Questions; Chapter 8: Creating a Timer; 8.1 Making Another Game; 8.2 Finding Winners Using Arrays; 8.3 Conclusion; 8.4 Chapter Review Questions; Chapter 9: Reading Text Input; 9.1 Using the Keyboard in XNA; 9.2 Working with Arrays, Objects, and References; 9.3 Displaying Keys; 9.4 Conclusion; 9.5 Chapter Review Questions; Writing Proper Games; Chapter 10: Using C# Methods to Solve Problems; 10.1 Introduction; 10.2 Playing with Images; 10.3 Creating a Zoom-Out; 10.4 Conclusion; 10.5 Chapter Review Questions; Chapter 11: A Game as a C# Program; 11.1 Introduction; 11.2 Creating Game Graphics; 11.3 Projects, Resources, and Classes; 11.4 Creating Game Objects; 11.5 Conclusion; 11.6 Chapter Review Questions; Chapter 12: Games, Objects, and State; 12.1 Introduction; 12.2 Adding Bread to Your Game; 12.3 Adding Tomato Targets; 12.4 Conclusion; 12.5 Chapter Review Questions; Chapter 13: Making a Complete Game; 13.1 Introduction; 13.2 Making a Finished Game; 13.3 Improving Code Design; 13.4 Adding a Background; 13.5 Adding a Title Screen; 13.6 Conclusion; 13.7 Chapter Review Questions; Chapter 14: Classes, Objects, and Games; 14.1 Introduction; 14.2 Design with Objects; 14.3 Classes and Structures; 14.4 References; 14.5 Value and Reference Types; 14.6 Creating a Sprite Class Hierarchy; 14.7 Adding a Deadly Pepper; 14.8 Conclusion; 14.9 Chapter Review Questions; Chapter 15: Creating Game Components; 15.1 Introduction; 15.2 Objects and Abstraction; 15.3 Constructing Class Instances; 15.4 Adding 100 Killer Tangerines; 15.5 Adding Artificial Intelligence; 15.6 Adding Game Sounds; 15.7 From Objects to Components; 15.8 Conclusion; 15.9 Chapter Review Questions; Chapter 16: Creating Multi-Player Networked Games; 16.1 Introduction; 16.2 Networks and Computers; 16.3 Xbox Live; 16.4 Bread and Cheese Pong; 16.5 Conclusion; 16.6 Chapter Review Questions; Making Mobile Games for Windows Phone 7 with XNA; Chapter 17: Motion-Sensitive Games; 17.1 Introduction; 17.2 The Accelerometer; 17.3 Acceleration and Physics; 17.4 Creating a Cheese Lander” Tipping Game; 17.5 Conclusion; 17.6 Chapter Review Questions; Chapter 18: Exploring Touch Input; 18.1 Introduction; 18.2 The Windows Phone Touch Screen; 18.3 Creating a Panic Button; 18.4 Creating a Touch Drumpad; 18.5 Creating a Shuffleboard Game; 18.6 Conclusion; 18.7 Chapter Review Questions; Chapter 19: Mobile Game Development; 19.1 Introduction; 19.2 The Windows Phone; 19.3 Maximizing the Phone Battery Life in XNA Games; 19.4 Dealing with Changes in Phone Orientation; 19.5 Using a Specific Display Size for Windows Phone Games; 19.6 Hiding the Windows Phone Status Bar; 19.7 Stopping the Screen Timeout from Turning Off Your Game; 19.8 Creating a Phone State Machine; 19.9 Handing Incoming Phone Calls; 19.10 A Game as a Windows Phone Application; 19.11 Getting Your Games into the Marketplace; 19.12 Conclusion; 19.13 Chapter Review Questions; Answers to the Chapter Review Questions; Chapter 1; Chapter 2; Chapter 3; Chapter 4; Chapter 5; Chapter 6; Chapter 7; Chapter 8; Chapter 9; Chapter 10; Chapter 11; Chapter 12; Chapter 13; Chapter 14; Chapter 15; Chappppppter 16; Chapter 17; Chapter 18; Chapter 19; About the Author; Rob Miles;