Introduction To Game Design, Prototyping, And

Transcription

Praise for Introduction to Game Design, Prototyping, andDevelopment"Introduction to Game Design, Prototyping, and Development combines a solid grounding inevolving game design theory with a wealth of detailed examples of prototypes for digitalgames. Together these provide an excellent introduction to game design and developmentthat culminates in making working games with Unity. This book will be useful for both introductory courses and as a reference for expert designers. I will be using this book in my gamedesign classes, and it will be among those few to which I often refer."—Michael SellersProfessor of Practice in Game Design, Indiana University, former Creative Directorat Rumble Entertainment, and General Manager at Kabam"Prototyping and play-testing are often the most misunderstood and/or underutilized stepsin the game design and development process. Iterative cycles of testing and refining arekey to the early stages of making a good game. Novices will often believe that they need toknow everything about a language or build every asset of the game before they can really getstarted. Gibson's new book prepares readers to go ahead and dive in to the actual design andprototyping process right away; providing the basics of process and technology with excellent"starter kits" for different types of games to jumpstart their entry into the practice."—Stephen JacobsAssociate Director, RIT Center for Media, Art, Games, Interaction and Creativity (MAGIC)and Professor, School of Interactive Games and Media"Jeremy Gibson's Introduction to Game Design, Prototyping, and Development deftly combinesthe necessary philosophical and practical concepts for anyone looking to become a GameDesigner. This book will take you on a journey from high-level design theories, through gamedevelopment concepts and programming foundations in order to make your own playablevideo games. Jeremy uses his years of experience as a professor to teach the reader how tothink with vital game design mindsets so that you can create a game with all the right toolsat hand. A must-read for someone who wants to dive right into making their first game and agreat refresher for industry veterans."—Michelle PunSenior Game Designer, Zynga

This page intentionally left blank

Introduction to GameDesign, Prototyping,and Development

The Addison-WesleyGame Design and Development SeriesVisit informit.com/series/gamedesign for a complete list of available publications.Essential References for Game Designers and DevelopersThese practical guides, written by distinguished professors and industry gurus,cover basic tenets of game design and development using a straightforward,common-sense approach. The books encourage readers to try things on their ownand think for themselves, making it easier for anyone to learn how to design anddevelop digital games for both computers and mobile devices.Make sure to connect with us!informit .com/socialconnect

Introduction to GameDesign, Prototyping,and DevelopmentFrom Concept to PlayableGame—with Unity and C#Jeremy GibsonUpper Saddle River, NJ Boston Indianapolis San FranciscoNew York Toronto Montreal London Munich Paris MadridCapetown Sydney Tokyo Singapore Mexico City

Many of the designations used by manufacturers and sellers to distinguish theirproducts are claimed as trademarks. Where those designations appear in this book, andthe publisher was aware of a trademark claim, the designations have been printed withinitial capital letters or in all capitals.The authors and publisher have taken care in the preparation of this book, but makeno expressed or implied warranty of any kind and assume no responsibility for errorsor omissions. No liability is assumed for incidental or consequential damages inconnection with or arising out of the use of the information or programs containedherein.Editor-in-ChiefMark TaubSenior AcquisitionsEditorLaura LewinSenior DevelopmentEditorChris ZahnFor information about buying this title in bulk quantities, or for special salesopportunities (which may include electronic versions; custom cover designs; andcontent particular to your business, training goals, marketing focus, or brandinginterests), please contact our corporate sales department at corpsales@pearsoned.comor (800) 382-3419.Managing EditorKristy HartFor government sales inquiries, please contact governmentsales@pearsoned.com.Copy EditorKeith ClineFor questions about sales outside the U.S., please contact international@pearsoned.com.Visit us on the Web: informit.com/awLibrary of Congress Control Number: 2014936195Copyright 2015 Pearson Education, Inc.All rights reserved. Printed in the United States of America. This publication is protectedby copyright, and permission must be obtained from the publisher prior to anyprohibited reproduction, storage in a retrieval system, or transmission in any form orby any means, electronic, mechanical, photocopying, recording, or likewise. To obtainpermission to use material from this work, please submit a written request to PearsonEducation, Inc., Permissions Department, One Lake Street, Upper Saddle River, NewJersey 07458, or you may fax your request to (201) 236-3290.ISBN-13: 978-0-321-93316-4ISBN-10: 0-321-93316-8Project EditorElaine WileyIndexerKen JohnsonProofreaderPaula LowellTechnical EditorsMarc DestefanoCharles DubaMargaret MoserPublishing CoordinatorOlivia BasegioCover DesignerChuti PrasersithText printed in the United States on recycled paper at RR Donnelley inCrawfordsville, IN.Book DesignerBumpy DesignSecond Printing: January 2015CompositorNonie Ratcliff

This book is dedicated to:My wife Melanie, the love of my life,for her love, intellect, and supportMy parents and sistersAnd my many professors, colleagues, and studentswho inspired me to write this book.

This page intentionally left blank

Contents at a GlancePart I Game Design and Paper Prototyping . . . . . . . . . . . . . . . . 11 Thinking Like a Designer . . . . . . . . . . . . . . . . . . . . . . . . 32 Game Analysis Frameworks . . . . . . . . . . . . . . . . . . . . . . 193 The Layered Tetrad . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 The Inscribed Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 The Dynamic Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 The Cultural Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797 Acting Like a Designer . . . . . . . . . . . . . . . . . . . . . . . . . 898 Design Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1059 Paper Prototyping . . . . . . . . . . . . . . . . . . . . . . . . . . . 12510 Game Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14111 Math and Game Balance . . . . . . . . . . . . . . . . . . . . . . . 15512 Puzzle Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18513 Guiding the Player . . . . . . . . . . . . . . . . . . . . . . . . . . . 19714 The Digital Game Industry . . . . . . . . . . . . . . . . . . . . . . 211Part II Digital Prototyping . . . . . . . . . . . . . . . . . . . . . . . . . . 22315 Thinking in Digital Systems . . . . . . . . . . . . . . . . . . . . . 22516 Introducing Our Development Environment: Unity . . . . . . 23517 Introducing Our Language: C# . . . . . . . . . . . . . . . . . . . 25318 Hello World: Your First Program . . . . . . . . . . . . . . . . . . 26319 Variables and Components . . . . . . . . . . . . . . . . . . . . . 28120 Boolean Operations and Conditionals . . . . . . . . . . . . . . 29921 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31522 Lists and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32723 Functions and Parameters . . . . . . . . . . . . . . . . . . . . . . 34924 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36325 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37926 Object-Oriented Thinking . . . . . . . . . . . . . . . . . . . . . . 39127 The Agile Mentality . . . . . . . . . . . . . . . . . . . . . . . . . . 405

xCONTENTS AT A GLANCEPart III Game Prototype Examples and Tutorials. . . . . . . . . . . . . 41728 Prototype 1: Apple Picker . . . . . . . . . . . . . . . . . . . . . . 41929 Prototype 2: Mission Demolition . . . . . . . . . . . . . . . . . . 44930 Prototype 3: Space SHMUP . . . . . . . . . . . . . . . . . . . . . 48731 Prototype 4: Prospector Solitaire. . . . . . . . . . . . . . . . . . 56132 Prototype 5: Bartok . . . . . . . . . . . . . . . . . . . . . . . . . . 62133 Prototype 6: Word Game . . . . . . . . . . . . . . . . . . . . . . . 65734 Prototype 7: QuickSnap . . . . . . . . . . . . . . . . . . . . . . . 69535 Prototype 8: Omega Mage . . . . . . . . . . . . . . . . . . . . . 727Part IV Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791A Standard Project Setup Procedure. . . . . . . . . . . . . . . . . 793B Useful Concepts Reference . . . . . . . . . . . . . . . . . . . . . 799C Online References . . . . . . . . . . . . . . . . . . . . . . . . . . . 851Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857

ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxivPart I Game Design and Paper Prototyping . . . . . . . . . . . . . . 11 Thinking Like a Designer . . . . . . . . . . . . . . . . . . . . . . 3You Are a Game Designer. . . . . . . . . . . . . . . . . . . . . . . . . . 4Bartok: A Game Exercise. . . . . . . . . . . . . . . . . . . . . . . . . . . 4The Definition of Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Game Analysis Frameworks . . . . . . . . . . . . . . . . . . . 19Common Frameworks for Ludology . . . . . . . . . . . . . . . . . . 20MDA: Mechanics, Dynamics, and Aesthetics . . . . . . . . . . . . . 20Formal, Dramatic, and Dynamic Elements . . . . . . . . . . . . . . 24The Elemental Tetrad . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 The Layered Tetrad . . . . . . . . . . . . . . . . . . . . . . . . . 31The Inscribed Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32The Dynamic Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33The Cultural Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34The Responsibility of the Designer . . . . . . . . . . . . . . . . . . . 36Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 The Inscribed Layer. . . . . . . . . . . . . . . . . . . . . . . . . 39Inscribed Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Inscribed Aesthetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Inscribed Narrative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Inscribed Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

xiiCONTENTS5 The Dynamic Layer . . . . . . . . . . . . . . . . . . . . . . . . . 61The Role of the Player . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Emergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Dynamic Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Dynamic Aesthetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70Dynamic Narrative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75Dynamic Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776 The Cultural Layer . . . . . . . . . . . . . . . . . . . . . . . . . 79Beyond Play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80Cultural Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81Cultural Aesthetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82Cultural Narrative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Cultural Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84Authorized Transmedia Are Not in the Cultural Layer . . . . . . . 85The Cultural Impact of a Game . . . . . . . . . . . . . . . . . . . . . 86Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877 Acting Like a Designer . . . . . . . . . . . . . . . . . . . . . . . 89Iterative Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Innovation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Brainstorming and Ideation . . . . . . . . . . . . . . . . . . . . . . . 98Changing Your Mind . . . . . . . . . . . . . . . . . . . . . . . . . . . 101Scoping!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1048 Design Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Design Goals: An Incomplete List. . . . . . . . . . . . . . . . . . . 106Designer-Centric Goals . . . . . . . . . . . . . . . . . . . . . . . . . 106Player-Centric Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

CONTENTS9 Paper Prototyping . . . . . . . . . . . . . . . . . . . . . . . . 125The Benefits of Paper Prototypes. . . . . . . . . . . . . . . . . . . 126Paper Prototyping Tools . . . . . . . . . . . . . . . . . . . . . . . . 127An Example of a Paper Prototype. . . . . . . . . . . . . . . . . . . 129Best Uses for Paper Prototyping . . . . . . . . . . . . . . . . . . . 138Poor Uses for Paper Prototyping . . . . . . . . . . . . . . . . . . . 139Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14010 Game Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . .141Why Playtest? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Being a Great Playtester Yourself . . . . . . . . . . . . . . . . . . . 142The Circles of Playtesters . . . . . . . . . . . . . . . . . . . . . . . . 143Methods of Playtesting . . . . . . . . . . . . . . . . . . . . . . . . . 146Other Important Types of Testing . . . . . . . . . . . . . . . . . . 152Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15311 Math and Game Balance . . . . . . . . . . . . . . . . . . . . 155The Meaning of Game Balance . . . . . . . . . . . . . . . . . . . . 156Installing Apache OpenOffice Calc . . . . . . . . . . . . . . . . . . 156Examining Dice Probability with Calc . . . . . . . . . . . . . . . . 157The Math of Probability . . . . . . . . . . . . . . . . . . . . . . . . . 165Randomizer Technologies in Paper Games. . . . . . . . . . . . . 170Weighted Distributions . . . . . . . . . . . . . . . . . . . . . . . . . 173Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175Positive and Negative Feedback . . . . . . . . . . . . . . . . . . . 176Using Calc to Balance Weapons . . . . . . . . . . . . . . . . . . . . 177Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18312 Puzzle Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 185Puzzles Are Almost Everywhere. . . . . . . . . . . . . . . . . . . . 186Scott Kim on Puzzle Design . . . . . . . . . . . . . . . . . . . . . . 186Puzzle Examples in Action Games . . . . . . . . . . . . . . . . . . 193Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195xiii

xivCONTENTS13 Guiding the Player . . . . . . . . . . . . . . . . . . . . . . . . 197Direct Guidance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198Indirect Guidance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Teaching New Skills and Concepts . . . . . . . . . . . . . . . . . . 207Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21014 The Digital Game Industry . . . . . . . . . . . . . . . . . . . .211About the Game Industry. . . . . . . . . . . . . . . . . . . . . . . . 212Game Education . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215Getting into the Industry . . . . . . . . . . . . . . . . . . . . . . . . 217Don't Wait to Start Making Games!. . . . . . . . . . . . . . . . . . 221Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222Part II Digital Prototyping . . . . . . . . . . . . . . . . . . . . . . . . 22315 Thinking in Digital Systems. . . . . . . . . . . . . . . . . . . 225Systems Thinking in Board Games . . . . . . . . . . . . . . . . . . 226An Exercise in Simple Instructions . . . . . . . . . . . . . . . . . . 226Game Analysis: Apple Picker. . . . . . . . . . . . . . . . . . . . . . . . . 229Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23416 Introducing Our Development Environment: Unity . . . 235Downloading Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . 236Introducing Our Development Environment . . . . . . . . . . . 237Running Unity for the First Time . . . . . . . . . . . . . . . . . . . 241Setting Up the Unity Window Layout . . . . . . . . . . . . . . . . 246Learning Your Way Around Unity . . . . . . . . . . . . . . . . . . . 251Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25117 Introducing Our Language: C#. . . . . . . . . . . . . . . . . 253Understanding the Features of C# . . . . . . . . . . . . . . . . . . 254Reading and Understanding C# Syntax . . . . . . . . . . . . . . . 259Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

CONTENTS18 Hello World: Your First Program . . . . . . . . . . . . . . . . 263Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . 264Making a New C# Script . . . . . . . . . . . . . . . . . . . . . . . . . 266Making Things More Interesting . . . . . . . . . . . . . . . . . . . 271Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27919 Variables and Components. . . . . . . . . . . . . . . . . . . 281Introducing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 282Strongly Typed Variables in C# . . . . . . . . . . . . . . . . . . . . 282Important C# Variable Types . . . . . . . . . . . . . . . . . . . . . . 283The Scope of Variables . . . . . . . . . . . . . . . . . . . . . . . . . 286Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 286Important Unity Variable Types . . . . . . . . . . . . . . . . . . . . 288Unity GameObjects and Components. . . . . . . . . . . . . . . . 294Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29720 Boolean Operations and Conditionals . . . . . . . . . . . . 299Booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . 303Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . 307Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31321 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .315Types of Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316Set Up a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316do.while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . 319for Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320foreach Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322Jump Statements within Loops . . . . . . . . . . . . . . . . . . . . 322Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325xv

xviCONTENTS22 Lists and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 327C# Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . 337Jagged Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Whether to Use Array or List . . . . . . . . . . . . . . . . . . . . . . 344Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Summary Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Moving Forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34723 Functions and Parameters . . . . . . . . . . . . . . . . . . . 349Set Up the Function Examples Project . . . . . . . . . . . . . . . 350Definition of a Function . . . . . . . . . . . . . . . . . . . . . . . . . 350Function Parameters and Arguments . . . . . . . . . . . . . . . . 353Returning Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354Proper Function Names . . . . . . . . . . . . . . . . . . . . . . . . . 356When Should You Use Functions? . . . . . . . . . . . . . . . . . . 356Function Overloading . . . . . . . . . . . . . . . . . . . . . . . . . . 358Optional Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 359The params Keyword. . . . . . . . . . . . . . . . . . . . . . . . . . 359Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 361Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36224 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Getting Started with Debugging . . . . . . . . . . . . . . . . . . . 364Stepping Through Code with the Debugger. . . . . . . . . . . . 369Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37725 Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379Understanding Classes . . . . . . . . . . . . . . . . . . . . . . . . . 380Class Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390

CONTENTS26 Object-Oriented Thinking . . . . . . . . . . . . . . . . . . . 391The Object-Oriented Metaphor . . . . . . . . . . . . . . . . . . . . 392An Object-Oriented Boids Implementation . . . . . . . . . . . . 394Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40327 The Agile Mentality. . . . . . . . . . . . . . . . . . . . . . . . 405The Manifesto for Agile Software Development . . . . . . . . . 406Scrum Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . 407Creating Your Own Burndown Charts . . . . . . . . . . . . . . . . 416Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416Part III Game Prototype Examples and Tutorials . . . . . . . . . . .41728 Prototype 1: Apple Picker . . . . . . . . . . . . . . . . . . . . .419The Purpose of a Digital Prototype. . . . . . . . . . . . . . . . . . 420Preparing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421Coding the Apple Picker Prototype . . . . . . . . . . . . . . . . . 428GUI and Game Management. . . . . . . . . . . . . . . . . . . . . . 440Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44829 Prototype 2: Mission Demolition . . . . . . . . . . . . . . . 449Getting Started: Prototype 2. . . . . . . . . . . . . . . . . . . . . . 450Game Prototype Concept. . . . . . . . . . . . . . . . . . . . . . . . 450Art Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451Coding the Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . 456Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48530 Prototype 3: Space SHMUP . . . . . . . . . . . . . . . . . . 487Getting Started: Prototype 3. . . . . . . . . . . . . . . . . . . . . . 488Setting the Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490Making the Hero Ship . . . . . . . . . . . . . . . . . . . . . . . . . . 491Adding Some Enemies . . . . . . . . . . . . . . . . . . . . . . . . . 504xvii

xviiiCONTENTSSpawning Enemies at Random . . . . . . . . . . . . . . . . . . . . 509Setting Tags, Layers, and Physics . . . . . . . . . . . . . . . . . . . 510Making the Enemies Damage the Player . . . . . . . . . . . . . . 513Restarting the Game . . . . . . . . . . . . . . . . . . . . . . . . . . . 518Shooting (Finally) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519Adding Power-Ups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Resolving Race Conditions in Code . . . . . . . . . . . . . . . . . 538Making Enemies Drop Power-Ups . . . . . . . . . . . . . . . . . . 541Programming Other Enemies . . . . . . . . . . . . . . . . . . . . . 543Adding Particle Effects and Background . . . . . . . . . . . . . . 556Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55831 Prototype 4: Prospector Solitaire . . . . . . . . . . . . . . . 561Getting Started: Prototype 4. . . . . . . . . . . . . . . . . . . . . . 562Build Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562Importing Images as Sprites . . . . . . . . . . . . . . . . . . . . . . 564Constructing Cards from Sprites . . . . . . . . . . . . . . . . . . . 566The Prospector Game . . . . . . . . . . . . . . . . . . . . . . . . . . 583Implementing Prospector in Code . . . . . . . . . . . . . . . . . . 585Adding Scoring to Prospector . . . . . . . . . . . . . . . . . . . . . 604Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62032 Prototype 5: Bartok. . . . . . . . . . . . . . . . . . . . . . . . 621Getting Started: Prototype 5. . . . . . . . . . . . . . . . . . . . . . 622Build Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623Coding Bartok . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655

CONTENTS33 Prototype 6: Word Game . . . . . . . . . . . . . . . . . . . . 657Getting Started: Word Game Prototype. . . . . . . . . . . . . . . 658About the Word Game . . . . . . . . . . . . . . . . . . . . . . . . . 658Parsing the Word List . . . . . . . . . . . . . . . . . . . . . . . . . . 660Setting Up the Game . . . . . . . . . . . . . . . . . . . . . . . . . . 665Laying Out the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . 671Adding Interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . 680Adding Scoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684Adding Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687Adding Color. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69234 Prototype 7: QuickSnap . . . . . . . . . . . . . . . . . . . . . 695Getting Started: QuickSnap Prototype . . . . . . . . . . . . . . . 696Building the Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697Coding the Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72635 Prototype 8: Omega Mage. . . . . . . . . . . . . . . . . . . 727Getting Started: Omega Mage Prototype . . . . . . . . . . . . . 728Building the Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730The Mage Character . . . . . . . . . . . . . . . . . . . . . . . . . . . 735Mouse Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741The Inventory and Selecting Elements . . . . . . . . . . . . . . . 747Casting the Fire Ground Spell . . . . . . . . . . . . . . . . . . . . . 754Changing Rooms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764Spawning Enemies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768Abstracting the Enemy Interface . . . . . . . . . . . . . . . . . . . 782xix

xxCONTENTSMaking an EnemyFactory. . . . . . . . . . . . . . . . . . . . . . . . 785Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789Thanks! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789Part IV Appendices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791A Standard Project Setup Procedure . . . . . . . . . . . . . . 793B Useful Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 799C# and Unity Coding Concepts . . . . . . . . . . . . . . . . . . . . 801Math Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822Interpolation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831Roleplaying Games. . . . . . . . . . . . . . . . . . . . . . . . . . . . 846User Interface Concepts. . . . . . . . . . . . . . . . . . . . . . . . . 848C Online Reference . . . . . . . . . . . . . . . . . . . . . . . . . 851Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852Unity Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853Searching Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854Finding Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854Educational Software D

This book will take you on a journey from high-level design theories, through game development concepts and programming foundations in order to make your own playable video games. Jeremy uses his years of experience as a professor to teach the reader how to think with vital game design mindsets so that you ca