iOS: Game
Development
for
iPhone,
iPad,
and HTML5
iDavid Guerineau
Apress*
CONTENTS
Contents
About the Author xii About theTechnical Reviewer xiii
Acknowledgments
xivIntroduction
xvPart 1:
Learning
the GameSalad Fundamentals 1Chapter
1:Preparing
YourDesign
Environment 3 GameSaladRequirements
3Registering
to GameSalad 4About GameSalad Pro 5
Registering
in the iOSDeveloper Program
6Installing
Xcode 14Installing
GameSalad Creator 17Installing
GameSalad iOS Viewer 19 Whyis GameSalad iOS Viewerapieceofcode? 19GettingtheGameSalad iOS Viewer 20
InstallingtheDeveloperCertificate in YourKeychain 20
CreatingaProvisioningProfile for iOS Viewer 23
InstallingiOSViewer 26
Summary
29Chapter
2: Your First Game from Scratch: ThePong
Game .31 A Little Bit ofHistoryAbout Pong
31Specifying
the GameConcept
and Rules 34The GameConcept 34 The Game Rules 35
Creating
a New GameSaladProject
35Adding
Actors 39What isanactor? 39
Creatingactors 40
Modifying
Actors Attributes 41InstanceorPrototype 41 Actor Attributes 42
CommonlyUsed Attributes 42
ModifyingAttributes 44
Adding
Behaviors 46Whatarebehaviors? 46
AddingBehaviors 47
Adding
an Actor to the Scene 51Creating
Other Actors 52RacketPlayer2 53 The Ball 54 Walls 60 Tags 61 Let's
Play
63Summary
63£
Chapter
3:Finishing
Pong: Scoring
and Game Interaction 65Let's
Keep
Score 65It's All About the Ace! 74
ServingFeature: The Winner of the Point Serves the NextBall 74
KeepingOne Ball in the GameataTime 76
Do You Have the Touch? 79
ServingwithaPinch of Touch 79
Giving
Your Game a Brain 81Detectingthe Direction andGettingthe Y Value 81
Moving Player2 Rackettothe Stored Value 83
Pong,
Talk to Me 84Let's
Play
onYour Device 85Summary
86«
Chapter
4: Break A Wall:Implementing Comments,
AccelerometerMovements,
LifeManagement,
and Pause 87Laying
Down the Basics 90Definingthe NewProject 90
Definingthe Actors 90
CreatingtheCollidable Tag 97
Definingthe Attributes 98
Implementingthe Rules andBehaviors 98
Layoutof the Scene 106
CONTENTS
Commenting
Your Work 107Moving
thePaddle with the Accelerometer 109Managing
Lives and the GameOver process 115Adding
a PauseFeature 119Summary
123B
Chapter
5:Making
a Shoot 'EmUp
Game: Carrot Invader 125Preparing
theBasic Elementsof the Scene 127 Creatingthe Carrot Invader GameProject 127 Artist Entrance:Creatingthe Actors 127Controllingthe Number of Enemies with Game Attributes 133
SettingtheScreenplay: ImplementingRulesandBehaviors 134 The Invasion isStarting: Creatingthe SceneLayout 142
Adding
Advanced Features 143ComplexMovements 143
GivingtheImpressionofSpaceshipMovement 148
ManagingtheEnergyBar 152 SceneManagement 157
Summary...
158 Part2: Let'sSpice Up
the Saladwith Advanced Functions and EffectsinGameSalad 159
Chapter
6:Learning Gravity,
BasicPhysics,
and Camera Controls: AnAngry
Birds-likeGame,
Part I 161Building
aSlingshot:
Elastic and Pullback Force 162AnatomyofaSlingshot 162
Buildingthe Pullback Force 166 How to SimulateanElastic in GameSalad 175
Controlling
theCamera:Scrolling
Across the Scene ...184TheScreenvs.the Scene 184
ImplementingtheScrolling 186
Flying
andFalling
Down:Gravity Concepts
187OnceUponaTime,There WasanApple 187
FlyingandDragging 188
MoreCamera Controls:
Zooming
In/Out WhileFlying...
189ZoomingOut 189
ZoomingIn 191
Projectile Management:
Managing
theAttempts
193 AddingBoundaries 193Creating Dummy Projectiles 195
ModifyingtheProjectileInstance 198
Summary
• 202m
Chapter
7:Creating
a Game Menu and a Particles Effect: AnAngry
Birds-likeGame,
Part II 203Aiming
ataTarget: Destroying
Blocks 204Creatingthe Blocks:Hard,Soft,andtheTarget 204 Make ThemCollide 205 Ground ThemonEarth:Gravity 206
Letthe ActorsEnter the Scene 207
Witha Touch of
Style:
The Particle Effect 208 The Parametersof the Particle Effect 208 AnExplosionof Colors 213Performance
Optimization
with Tables 217Introduction to TablesinGameSalad 217
ManagingSeveral Scenes in One Scene 220
Adding
a Cool Menu 234Creatingthe Menu Scene 234
ManagingUnlocked Levels 235
ImplementingtheSlidingEffect 238
EnablingLevel Selection 242
AddingaMenu Buttononthe Initial Scene 244
Summary
245Chapter
8:Graphics
and Sound Effects:Labyrinth
247Creating
theLabyrinth
GameProject
248Creating
Actors for theLabyrinth
Game 248Defining
the GameLogic
with RulesandBehaviors 253Designing
the Game Areaby Laying
Out theScene 263Implementing
Lighting Special
Effects 266Implementing
SoundSpecial
Effects 267Summary
270Part 3:
Prepping
for theApp
Store:Polishing, Publishing,
andPromoting
YourGame 271
a
Chapter
9:Bonuses,GameCenter,
and iAd: Break aWall 273Designing
the Start Screen 274 Creatingthe Actors 275ImplementingRules and Behaviors 276
Adding
ScoreKeeping
283CONTENTS
ScoreDisplayActor 286
ScoreDisplayRulesand Behaviors 287
Creating
the Extra-Bonus Actors 28950ptcap Actor 289
Implementing
the Extra-Bonus Rules and Behaviors 291Posting
Scores onGame Center Leaderboard 300Loginto Game Center 301
PostingaScore 302
Showingthe Scores 303
iAd 304
Summary
306Chapter
10: Device Internal Clock andCyclic
Movement: Non-GameApps307
Creating
anAnalog
Clock with the Device Clock andRotation 308Accessingthe Device Clock 309 Creatingthe ClockProject 309
CreatingtheBackgroundand the Clock Hands 310 Creatingthe Clock Mechanisms: Rulesand Behaviors 313
Assemblingthe Clock:Layingout the Scene 317
Cyclic
Movement: The Metronome 318Creatingthe MetronomeProject 319 MetronomeMechanical Components:CreatingtheActors 320
StoringInformation:DefiningtheAttributes 323
Creating Mechanical Movements: Rules and Behaviors 324
Buildingthe Metronome:Layingoutthe Scene 338
Summary 340
Chapter 11:
Submitting
YourGameto theApp
Store 341Getting
theAppID, Certificate,
and DistributionProvisioning
Profile ontheProvisioning
Portal 342CreatingYourAppID 342 Your Distribution Certificate 343
Creatingthe DistributionProvisioningProfile 343
Creating
the Gameon iTunes Connect 345Step1:LoggingintoiTunes Connect 345
Step2:CreatingaNewApp 346
Step3:ProvidingBasic Information 346
Step4:ReleaseDateandPricingInformation 347
Step5:ProvidingVersion andCategoryInformation 347
Step6:DefiningYourApplication Rating 348
Step7:ProvidingMetadata Information 349
Step8:ReadingandAcceptingthe EULAAgreement 350 X
Step9: ProvidingtheGame Artwork 350
EnablingGame Center for YourApp 352
EnablingiAd 356
Updating
Game Center in GameSalad 357Publishing
the Game Inside GameSalad 357Step1:SelectingtheTargetedPlatform 357
Step2:ProvidingOverview Information 358
Step3:SelectingYourProvisioningProfile 360
Step4:ProvidingaLink toaPromotional YouTube Video 362
Step5:UploadingYourScreenshots 362
Step6:ReadingandAcceptingtheAgreement 362
Step7:CompressingYourFile 364
Uploading
the Game to iTunes 364Wait and Waitand Wait 369 Your Game is
Ready
for Sale 370Summary
3709
Chapter
12: Introduction to Game Promotion 371Pre-Development
Phase 372 DefiningYourTargetedCustomers 372IdentifyingandQualifyingYourCompetition 374
CreatingYourUniqueValue Proposition 377
Operational Tactics 380
WritingaPress Release 380
CreatingaWeb Page 381
GettingYour Game ReviewedonAppReview WebSites 382
CreatingaFacebookPage 382
Summary
386Who This Book Is For xiv
WhatYou Will Learn xiv
Downloadingthe Code xv
ContactingtheAuthor xv
if Index 387