ENGLISH

Windows Mobile Game Development: Building Games for the Windows Phone and Other MobileDevices

Book information

Publisher
Apress
Year
2010
ISBN
978-1-4302-2929-2
Language
english
Format
PDF
Filesize
7 MB (7402866 bytes)
Pages
438\468
Library
mirknig.com
Time added
2011-12-05 17:23:38

Description

This book will provide you with a comprehensive guide to developing games for both the Windows Mobile platform and the Windows Phone using the industry standard programming languages C# and VB.NET.You will be walked through every aspect of developing for the Windows Mobile platform—from setting up your development environment for the first time to creating advanced 3D graphics. Finally, you’ll learn how you can make your applications available to others, whether distributing for free or selling online.Using extensive code samples throughout, you’ll gather all the information needed to create your own games and distribute them successfully for others to enjoy.Aimed primarily at C# developers, almost everything in the book can be used in VB.NET too. For those areas where this is not the case, workarounds are suggested so that VB.NET developers are still able to use the techniques described. Prelim......Page 1 Contents at a Glance......Page 6 Contents......Page 7 About the Author......Page 17 About the Technical Reviewer......Page 18 Acknowledgments......Page 19 Goal of This Book......Page 20 Part 1: Windows Mobile Development......Page 23 Windows Mobile and .NET......Page 25 Language Choices......Page 26 Emulators......Page 27 Numerous Windows Mobile Versions and Editions......Page 28 Windows Mobile......Page 29 Hardware Buttons......Page 30 Cooperation with Devices......Page 31 Installing Visual Studio......Page 32 Creating a Windows Mobile Project......Page 33 Visual Studio 2008......Page 34 Designing a Form......Page 36 Running the Application......Page 38 Sharing Files with an Emulated Device......Page 40 Targeting Different Platforms......Page 41 Running on a Real Device......Page 42 Removing the Security Warnings......Page 43 Debugging......Page 44 Debug Output......Page 45 Newsgroups......Page 46 GDI......Page 47 OpenGL ES......Page 48 Welcome to the World of Windows Mobile Development......Page 49 Developing for Touch Screen and Smart Phone Devices......Page 51 ControlBox Property......Page 53 Text Property......Page 54 Creating Non-Full-Screen Forms......Page 55 Losing and Gaining Focus......Page 56 Buttons......Page 57 Menu Design Considerations......Page 58 Submenus......Page 59 MainMenu Events......Page 60 Context Menus......Page 61 Concurrent Tick Events......Page 62 Other Timers......Page 63 File Dialog Controls......Page 64 Input Panels......Page 65 Capturing Camera Images......Page 67 The “Busy” Cursor......Page 68 On with the Game......Page 69 Part 2: Creating Games......Page 71 Let’s Paint......Page 73 Colors......Page 75 Pens......Page 77 Drawing Lines......Page 78 Drawing Polygons......Page 79 Drawing Ellipses......Page 81 Displaying Text......Page 82 Using Different Fonts......Page 83 Centering Text......Page 84 Painting in Action......Page 85 Creating Bitmaps Using Graphics Primitives......Page 86 Creating Bitmaps from Predrawn Graphics......Page 87 Embedding Graphic Resources......Page 88 A Note About Graphic File Formats......Page 90 Partial Bitmap Copying......Page 91 Color Keys......Page 93 Smooth Animation......Page 94 Getting the Most From GDI......Page 98 Designing the Game Engine......Page 99 CGameEngineBase......Page 101 Game Mechanics......Page 104 Rendering......Page 105 Advancing the Game......Page 106 CGameObjectBase......Page 107 Positioning Objects......Page 108 CGameObjectGDIBase......Page 109 CGameEngineGDIBase......Page 110 Rendering......Page 111 CGameFunctions......Page 112 Creating the Bounce Example Game......Page 113 CBounceGame......Page 114 CObjBall......Page 115 Getting the Game Running......Page 117 Optimizing Rendering......Page 120 Forcing a Repaint......Page 124 Minimizing and Restoring......Page 125 Handling the SIP......Page 127 Checking Device Capabilities......Page 128 Next Steps......Page 131 Processor Speed......Page 133 Overcoming Performance Inconsistencies......Page 134 Dynamic Update Intervals......Page 135 The Problem with Dynamic Intervals......Page 136 Interpolated Updates......Page 137 Applying Interpolated Updates to a Game......Page 138 Update Frequency......Page 140 Distinguishing Between Updates and Frames......Page 141 The High-Performance Timer......Page 142 Initializing and Interrogating the Timer......Page 143 CGameEngineBase......Page 146 CGameObjectBase......Page 148 CGameObjectGDIBase......Page 149 Let’s Bounce Again......Page 150 Touch Screen Events......Page 151 DoubleClick......Page 152 MoveMove......Page 153 Selecting an Object......Page 154 Dragging Objects......Page 160 Swiping Objects......Page 162 Adding Context Menus......Page 166 Using Finger-Friendly Input......Page 168 KeyPress......Page 169 KeyDown......Page 170 Reading the Keyboard State......Page 171 Choosing the Keyboard Input Method......Page 172 Initializing the Accelerometer......Page 173 Reading Data from the Accelerometer......Page 174 Detecting the Presence of a Supported Accelerometer......Page 176 Considering Input Design......Page 178 Understanding Sound File Types......Page 179 Exploring the Available Sound APIs......Page 180 PlaySound......Page 182 System.Media.SoundPlayer......Page 186 AygShell Sound Functions......Page 189 BASS.dll......Page 191 Wrapping BASS.NET......Page 192 Adding Support for Sounds to the Game Engine......Page 198 Make Some Noise......Page 199 Creating the GemDrops Design Brief......Page 201 Conceptualizing the Game Controls......Page 204 Outlining the Minimum Requirements......Page 205 Creating the Project......Page 206 Creating the Game Form......Page 207 Preparing the Game......Page 208 Creating the Gem Game Object......Page 210 Resetting the Game......Page 213 Enhancing CObjGem......Page 216 Enhancing the Game Class......Page 219 Updating the Player’s Gems......Page 222 Moving the Gems to the Side......Page 230 Rotating the Gems......Page 232 Quickly Dropping the Gems......Page 234 Implementing Control in the User Interface......Page 235 Removing Gems from the Board......Page 237 Removing Gem Groups......Page 238 Removing Rainbow Gems......Page 242 Creating Score Objects......Page 243 Finishing Up......Page 246 Managing Game Settings......Page 247 Using the Settings Class......Page 248 Setting and Retrieving Values......Page 250 Loading and Saving Settings......Page 251 Using the MessageBox Class......Page 252 Displaying the Message......Page 253 Setting the Dialog Presentation Properties......Page 254 Initializing the High Score Table......Page 255 Displaying the High Scores Dialog......Page 256 Understanding the Data Structure......Page 257 Storing Data......Page 258 Creating an About Box......Page 260 Using the About Box Class......Page 261 Using Common Game Components......Page 263 Part 3: OpenGL ES Graphics......Page 265 Hardware Support......Page 267 Transparency and Alpha Blending......Page 268 Color Specification......Page 269 Calling OpenGL from Managed Languages......Page 270 Considering the Hardware Capabilities and Limitations......Page 271 Configuring the Project......Page 272 Creating the OpenGL Environment......Page 274 Initializing OpenGL......Page 276 Rendering Graphics in OpenGL......Page 278 Adding Form Functions......Page 282 Terminating OpenGL......Page 283 Running the Program......Page 284 Adding Some Sparkle......Page 285 Setting the Identity Matrix......Page 286 Applying Rotation Transformations......Page 287 Applying Scaling Transformations......Page 288 Rotating Objects......Page 289 The Orbits Project......Page 291 The FractalTrees project......Page 293 Drawing Lines......Page 296 Drawing Triangles......Page 297 Loading Graphics......Page 299 Rendering with Textures......Page 300 Specifying Texture Coordinates......Page 302 Applying Transparency......Page 304 Alpha Blending......Page 305 Textures with Alpha Channels......Page 306 Knowing the Available Blending Factors......Page 307 Understanding Orthographic Coordinate Systems......Page 308 Taking Control of OpenGL......Page 310 Adding OpenGL to the Game Engine......Page 311 Initializing OpenGL......Page 312 Calling Utility Functions......Page 313 Setting the Object State for OpenGL......Page 314 Rendering Quadrilaterals......Page 315 Performing the Capabilities Check......Page 316 Creating the Game Form......Page 318 Preparing the Balloons Game......Page 320 Setting up the Projection Matrix......Page 321 Rendering the Balloons......Page 323 Sorting the Balloons......Page 325 Playing the Game......Page 328 2D Possibilities with OpenGL......Page 331 Understanding the Viewing Frustum......Page 333 Defining the Viewing Frustum in OpenGL......Page 337 Enabling the Depth Buffer......Page 338 Defining a 3D Object......Page 340 Removing Hidden Surfaces......Page 346 Using Indexed Triangles......Page 348 Exploring the Types of Illumination......Page 351 Diffuse Light......Page 352 Specular Light......Page 353 Emissive Material......Page 354 Using Multiple Lights......Page 355 Directional Lights......Page 356 Spotlights......Page 357 Describing a Triangle’s Face Direction......Page 358 Calculating Normals......Page 360 Using Surface Normals and Vertex Normals......Page 361 Enabling Lighting......Page 362 Adding the Game Engine Light Functions......Page 363 Creating Point Lights......Page 365 Setting the Scene’s Ambient Light......Page 366 Setting Material Properties......Page 367 OpenGL Lighting in Action......Page 368 Calculating Normals Programmatically......Page 369 Mastering the 3D World......Page 373 Introducing SketchUp......Page 375 Creating 3D Objects in SketchUp......Page 376 Exporting 3D Geometry......Page 378 Using the .0bj File Format......Page 379 Retrieving Geometry Data......Page 381 Manipulating Geometry Data......Page 382 Using the Geometry Loader Class......Page 384 Positioning the Camera......Page 386 Adding Camera Objects to the Game Engine......Page 387 Lights, Camera, Action!......Page 392 Optimizing the Camera Calculation......Page 393 Rendering Fog......Page 396 Using Fog......Page 397 Rendering Billboards......Page 399 Adding Billboard Support to the Game Engine......Page 401 Learning More about OpenGL ES......Page 403 Settings the Assembly Properties......Page 407 Project Versioning......Page 409 Creating an Icon......Page 410 Switching into Release Mode......Page 413 Creating the Setup Project......Page 414 Adding the Setup Project’s Files......Page 415 Creating a Programs Menu Shortcut......Page 417 Creating Evaluation Applications......Page 419 Upgrading to Full Versions......Page 420 Using Windows Marketplace for Mobile......Page 422 Minimizing Piracy......Page 423 Implementing Reverse Engineering......Page 424 Obfuscating with Dotfuscator Community Edition......Page 425 Using Advanced Obfuscation......Page 427 Reflector.NET Protection......Page 428 Releasing New Versions of Your Game......Page 429 Promoting Your Game......Page 431 Go Create!......Page 432 Index......Page 433

Similar books