iphone ipad game development for dummies

508 797 0
iphone  ipad game development for dummies

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Neal Goldstein Jon Manning Paris Buttfield-Addison Learn to: • Build an actual game from start to finish • Recognize what makes a good game for A pple’s mobile devices • Use Objective-C®, Cocoa®, OpenGL ES 2 .0, and other iOS programming tools • Connect your app to Facebook, get it in to the App Store, and market it iPhone ® & iPadGame Development Making Everything Easier! ™ Visit the companion Web site at www.dummies.com/go/ ipadiphonegameprogramming to find plenty of sample code and other materials to help you create the examples in this book Open the book and find: • The latest and greatest on the iPad, iPhone 4, and iOS 4.0 • Elements of great game design and architecture • Why you need to be a registered Apple developer • Why scoring is critical • How to debug your games • What provisioning is and why you need to know • Important social aspects of game design • Key differences between games on the iPad and the iPhone Neal Goldstein has a rock-star reputation among iPhone developers. He wrote iPhone Application Development For Dummies and frequently speaks at conferences. Jon Manning and Paris Buttfield-Addison are the founders of Secret Lab, a game design company that builds fun things for iPhone and iPad when the principals aren’t playing games for research. $29.99 US / $35.99 CN / £21.99 UK ISBN 978-0-470-59910-5 Programming/Apple/Mobile Device Go to Dummies.com ® for videos, step-by-step examples, how-to articles, or to shop! Start a fun hobby or a new career — create cool games for the hottest devices around! Got an idea for a fun iPad or iPhone game but don’t know what to do with it? Read this book and you will! You’ll see how to design games that play wonderfully on the small screen, what’s involved in becoming a registered developer, how to work with the SDK, key features of game architecture, how to market your games, and more. Get your game on! • What makes a good game? — learn the fundamentals of good game design • Put on your developer’s hat — become a registered Apple developer, learn how iOS games work, and understand the SDK • The stuff games are made of — build a native user interface, explore game architecture fundamentals, learn to animate objects in iOS, and grasp the basics of OpenGL • Keep score and get social — set up a scoring system and learn to tie your game into social networks like Facebook • To market, to market — get your game into the App Store and boost marketability with such bonus features as gestures, shaking, external displays, and ad-supported revenue iPhone ® & iPadGame Development Goldstein Manning Buttfield-Addison spine=1.01” www.it-ebooks.info spine=1.01” Mobile Apps There’s a Dummies App for This and That With more than 200 million books in print and over 1,600 unique titles, Dummies is a global leader in how-to information. Now you can get the same great Dummies information in an App. With topics such as Wine, Spanish, Digital Photography, Certification, and more, you’ll have instant access to the topics you need to know in a format you can trust. To get information on all our Dummies apps, visit the following: www.Dummies.com/go/mobile from your computer. www.Dummies.com/go/iphone/apps from your phone. Start with FREE Cheat Sheets Cheat Sheets include • Checklists • Charts • Common Instructions • And Other Good Stuff! Get Smart at Dummies.com Dummies.com makes your life easier with 1,000s of answers on everything from removing wallpaper to using the latest version of Windows. Check out our • Videos • Illustrated Articles • Step-by-Step Instructions Plus, each month you can win valuable prizes by entering our Dummies.com sweepstakes. * Want a weekly dose of Dummies? Sign up for Newsletters on • Digital Photography • Microsoft Windows & Office • Personal Finance & Investing • Health & Wellness • Computing, iPods & Cell Phones • eBay • Internet • Food, Home & Garden Find out “HOW” at Dummies.com *Sweepstakes not currently available in all countries; visit Dummies.com for official rules. Get More and Do More at Dummies.com ® To access the Cheat Sheet created specifically for this book, go to www.dummies.com/cheatsheet/iphoneandipadgamedevelopment www.it-ebooks.info by Neal Goldstein, Paris Butt eld-Addison, and Jon Manning iPhone ® & iPad Game Development FOR DUMmIES ‰ 01_599105-ffirs.indd i01_599105-ffirs.indd i 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info iPhone ® & iPad Game Development For Dummies ® Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 www.wiley.com Copyright © 2011 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permit- ted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http:// www.wiley.com/go/permissions. Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its af liates in the United States and other countries, and may not be used without written permission. iPhone and iPad are registered trademarks of Apple Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITH- OUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZA- TION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2010937820 ISBN: 978-0-470-59910-5 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 01_599105-ffirs.indd ii01_599105-ffirs.indd ii 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info About the Authors Neal Goldstein is a recognized leader in making state-of-the-art, cutting-edge technologies practical for commercial and enterprise development. He was one of the  rst technologists to work with commercial developers at  rms such as Apple Computer, Lucas lm, and Microsoft to develop commercial applications using object-based programming technologies. He was a pioneer in moving that approach into the corporate world for developers at Liberty Mutual Insurance, USWest (now Verizon), National Car Rental, EDS, and Continental Airlines, showing them how object-oriented programming could solve enterprise-wide problems. His book (with Jeff Alger) on object-oriented development, Developing Object-Oriented Software for the Macintosh (Addison Wesley), introduced the idea of scenarios and patterns to developers. He was an early advocate of the Microsoft .NET framework, and he successfully introduced it into many enterprises, including Charles Schwab. He was one of the earliest developers of Service Oriented Architecture (SOA), and as Senior Vice President of Advanced Technology and the Chief Architect at Charles Schwab, he built an integrated SOA solution that spanned the enterprise, from desktop PCs to servers to complex network mainframes. (He holds three patents as a result.) As one of IBM’s largest customers, he introduced the folks at IBM to SOA at the enterprise level and encouraged them to head in that direction. He is currently passionate about the real value mobile devices can pro- vide and has eight applications in the App Store. These include a series of Travel Photo Guides (http://travelphotoguides.com) developed with his partners at mobilefortytwo and a Digital Field Guides series (http:// lp.wileypub.com/DestinationDFGiPhoneApp) developed in partner- ship with John Wiley & Sons. He also has a cool little, free app — Expense Calendar — that allows you to keep track of things like expenses, mileage, and time by adding them to your calendar. Along with those apps, he has written several books on iPhone program- ming, including iPhone Application Development For Dummies (both edi- tions) and Objective-C For Dummies, and he coauthored (with Tony Bove) iPhone Application Development All-In-One For Dummies and iPad Application Development For Dummies. He is also the coauthor (with Jon Manning and Paris Butt eld-Addison) of a forthcoming book on using the Unity platform for game development. Because you can never tell what he’ll be up to next, check regularly at his Web site: www.nealgoldstein.com. You can also check out his Facebook page at www.facebook.com/nealgoldsteinbooks and follow him on Twitter at www.twitter.com/nealgoldstein. 01_599105-ffirs.indd iii01_599105-ffirs.indd iii 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info Jon Manning has a collection of careers, which he swaps out as neces- sary: He’s co-founder of Secret Lab (the world’s most dangerous mobile games startup), a Senior Software Engineer at Meebo, Inc. (where he builds mobile apps that reach a stupidly huge number of people), and a Graduate Researcher in Human-Computer Interaction at the University of Tasmania in Australia (a land of computers and kangaroos). When he isn’t working on apps or books, he’s working on adding more letters to the end of his name. He spends nowhere near enough time around cats. You can  nd Jon online at www.desplesda.net and on Twitter at www.twitter.com/desplesda. Paris Buttfi eld-Addison wears many hats: He’s co-founder of Secret Lab (www.secretlab.com.au), author, educator, and Product Manager (Mobile) at Meebo, Inc., one of the Web’s fastest growing consumer Internet companies (www.meebo.com). Paris has degrees in HCI, computer science, and medieval and modern history. He enjoys designing, producing, and build- ing awesome experiences for mobile devices. Through some miracle of time management, he is also a Graduate Researcher in information management at the University of Tasmania, Australia. You can  nd Paris on the Web at www. paris.id.au and on Twitter at www.twitter.com/parisba. 01_599105-ffirs.indd iv01_599105-ffirs.indd iv 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info Dedication Neal Goldstein: To my children Evan and Sarah, and all my personal and artist friends who have kept me centered on the (real) world outside of writ- ing and technology. But most of all, to my wife Linda, who is everything that I ever hoped for and more than I deserve. Yes, Sam . . . the light at the end of the tunnel is not a freight train. Jon Manning: To my family, for introducing me to this whole “computers” thing. Paris Buttfi eld-Addison: To my mother and father, for all the usual things — everything. Authors’ Acknowledgments There is no better acquisitions editor than Katie Feltman, who did a superb job of keeping us on track and doing whatever she needed to do to us to stay focused on writing. Linda Morris did a great job in the early stages of the project, and project editor Pat O’Brien made sure all the parts were pulled together. Also thanks to copy editor Jen Riggs and technical editor Erick Tejkowski for helping us make things clearer. Thanks again to our agent Carole Jelen for her continued work and support in putting together these projects. 01_599105-ffirs.indd v01_599105-ffirs.indd v 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info Publisher’s Acknowledgments We’re proud of this book; please send us your comments at http://dummies.custhelp.com. For other comments, please contact our Customer Care Department within the U.S. at 877-762-2974, out- side the U.S. at 317-572-3993, or fax 317-572-4002. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Media Development Project Editor: Pat O’Brien Acquisitions Editor: Katie Feltman Copy Editor: Jen Riggs Technical Editor: Erick Tejkowski Editorial Manager: Kevin Kirschner Media Development Assistant Project Manager: Jenny Swisher Media Development Associate Producers: Josh Frank, Marilyn Hummel, Douglas Kuhn, and Shawn Patrick Editorial Assistant: Amanda Graham Sr. Editorial Assistant: Cherie Case Cartoons: Rich Tennant (www.the5thwave.com) Composition Services Project Coordinator: Sheree Montgomery Layout and Graphics: Timothy C. Detrick, Joyce Haughey, Andrea Hornberger Proofreaders: Laura Albert, Shannon Ramsey Indexer: BIM Indexing & Proofreading Services Publishing and Editorial for Technology Dummies Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary Bednarek, Executive Acquisitions Director Mary C. Corder, Editorial Director Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Composition Services Debbie Stailey, Director of Composition Services 01_599105-ffirs.indd vi01_599105-ffirs.indd vi 10/1/10 11:15 PM10/1/10 11:15 PM www.it-ebooks.info Contents at a Glance Introduction 1 Part I: Getting Started 7 Chapter 1: Building Great iOS Games 9 Chapter 2: Becoming an iPhone Developer 25 Chapter 3: Your First Date with the SDK 41 Part II: Traffic, The Game 61 Chapter 4: How iOS Games Work 63 Chapter 5: Building the User Interface 81 Chapter 6: Making Objects Appear and Move 99 Chapter 7: The Life Cycle of an iOS Game 123 Chapter 8: Creating the Game Architecture 135 Chapter 9: Creating the Game Controller 145 Chapter 10: Using the Debugger 185 Chapter 11: Keeping Score in Your Game 201 Chapter 12: Storing User Preferences 217 Chapter 13: Death, Taxes, and iOS Provisioning 237 Chapter 14: Giving Your Game Music and Sound 261 Part III: The Social Aspects 277 Chapter 15: Building Multiplayer Games with Game Kit 279 Chapter 16: Game, Meet Facebook 303 Chapter 17: External Displays 325 Chapter 18: iAd 339 Part IV: The iPad 347 Chapter 19: The World of the iPad 349 Chapter 20: Adding Multiple Lanes for the iPad 359 Chapter 21: Using Gesture Recognizers 369 Chapter 22: Setting Up OpenGL 379 Chapter 23: Drawing with OpenGL 403 Chapter 24: Texturing with OpenGL 419 Chapter 25: Kicking Up Your Game a Notch 435 02_599105-ftoc.indd vii02_599105-ftoc.indd vii 10/1/10 11:28 PM10/1/10 11:28 PM www.it-ebooks.info Part V: The Part of Tens 445 Chapter 26: Ten Differences between the iPhone and the iPad 447 Chapter 27: Ten Ways to Market Your Game 451 Chapter 28: Ten Insanely Great Games 457 Index 461 02_599105-ftoc.indd viii02_599105-ftoc.indd viii 10/1/10 11:28 PM10/1/10 11:28 PM www.it-ebooks.info [...]... Ten Differences between the iPhone and the iPad 447 The iPad Is Social 447 The iPhone Is Personal 448 The iPad Offers More Direct Control 448 You Can Play the iPad Really Loud 448 iPhone Users Often Wear Headphones 448 Games Can’t Always Be Easily Scaled from iPad to iPhone 449 Users Expect More from an iPad Game 449 The iPhone Is Used in High-Distraction... apply to the iPad as much as they do to the iPhone When we talk about iOS, or iOS devices, we’re talking about the iPhone, the iPod touch, and the iPad Because these devices are so similar, whenever we refer to development on the iPhone, we also talk about development on the iPad as well Parts I, II, and III of this book discuss the development of the game for both the iPhone and the iPad Part IV has... create a class of games for mobile users that were once possible only on desktop PCs But not only that — Apple’s App Store provides a direct sales and distribution channel to potential users that really can’t be beaten The iPhone and iPad, and iOS in general, are game changers for the world of game development Never before has it been so easy for an individual, or a small group, to build a game that can... documentation before you just can’t take it anymore and plunge right into coding Naturally enough, you’ll have a few false starts and blind alleys until you find your way, but we predict that after reading this book, it’s (pretty much) smooth sailing About This Book iPhone & iPad Game Development For Dummies is a beginner’s guide to developing games for the iPhone, iPod touch, and iPad, which all run... kinds of games available there, and maybe even download a few free ones (as if we could stop you) How This Book Is Organized iPhone & iPad Game Development For Dummies has five main parts, which we explain in more detail in the following sections Part I: Getting Started Part I introduces you to the iOS game development world You find out what makes a great iOS game, and how to exploit the iPhone, iPod... your game design J ust as you find with any type of app, the range of games available for the iPhone (and iPad) is huge They range from games that are expected to be chart busters from the beginning (the games produced by giant studios, such as Electronic Arts) to games made by individuals in their spare time that become huge hits (for example, Trism and Flight Control) So, as a soon-to-be iPhone and iPad. .. PM10/1/10 11:28 PM xii iPhone & iPad Game Development For Dummies Removing Cars from the Game Board 165 Earning More Time 170 Detecting Collisions 172 Updating the Counter 174 Pausing the Game 177 Creating the Pause view 177 Pausing 179 Making the Game End 181 Creating the game over view 181 Handling the Game Over event... do is add your game s user interface and game play mechanics to the framework, and then poof an instant game Well, sort of — but we help you through the patches that are a bit more challenging, as we guide you along the way to making an awesome game www.it-ebooks.info 03_599105-intro.indd 103_599105-intro.indd 1 10/1/10 11:33 PM10/1/10 11:33 PM 2 iPhone & iPad Game Development For Dummies If you’re... technologies with your game, including Apple’s Game Kit framework for wireless networking among people on multiple devices, Facebook for posting social updates, and external display support for making your game have more of a party atmosphere Part IV: The iPad With the basics behind you and a good understanding of the iPhone game architecture under your belt, it’s time to talk about money and the iPad In this... Building Multiplayer Games with Game Kit 279 Understanding the Basics of Game Kit 280 Designing a Multiplayer Version of a Single-Player Game 281 Competitive multiplayer 281 Cooperative multiplayer 282 www.it-ebooks.info 02_599105-ftoc.indd xiii02_599105-ftoc.indd xiii 10/1/10 11:28 PM10/1/10 11:28 PM xiv iPhone & iPad Game Development For Dummies Picking the paradigm . to www .dummies. com/cheatsheet/iphoneandipadgamedevelopment www.it-ebooks.info by Neal Goldstein, Paris Butt eld-Addison, and Jon Manning iPhone ® & iPad ™ Game Development FOR DUMmIES ‰ 01_599105-ffirs.indd. All-In-One For Dummies and iPad Application Development For Dummies. He is also the coauthor (with Jon Manning and Paris Butt eld-Addison) of a forthcoming book on using the Unity platform for game. books on iPhone program- ming, including iPhone Application Development For Dummies (both edi- tions) and Objective-C For Dummies, and he coauthored (with Tony Bove) iPhone Application Development

Ngày đăng: 24/04/2014, 15:22

Từ khóa liên quan

Mục lục

  • iPhone® & iPad™ Game Development For Dummies®

    • About the Authors

    • Dedication

    • Authors’ Acknowledgments

    • Contents at a Glance

    • Table of Contents

    • Introduction

      • About This Book

      • Conventions Used in This Book

      • Foolish Assumptions

      • How This Book Is Organized

      • Icons Used in This Book

      • Where to Go from Here

      • Part I: Getting Started

        • Chapter 1: Building Great iOS Games

          • Figuring Out What a User Wants from an iPhone Game

          • Establishing a Game Developer Mindset

          • Noting the Features of Good Games

          • Designing a Good Game

          • Evolving the Game

          • What’s Next

          • Chapter 2: Becoming an iPhone Developer

            • Becoming a Registered iPhone Developer

            • Exploring the iPhone Dev Center

            • Downloading the SDK

Tài liệu cùng người dùng

Tài liệu liên quan