Foreword |
|
xiii | |
Acknowledgments |
|
xvii | |
Preface |
|
xix | |
Get Ready for Game Development |
|
xxv | |
|
Part I Build Your First Game with SpriteKit |
|
|
|
1 Creating Scenes with Sprites and Nodes |
|
|
3 | (24) |
|
|
3 | (4) |
|
Explore the Default Template |
|
|
7 | (1) |
|
Clean Up the Default Template |
|
|
8 | (2) |
|
Set the Supported Device Orientation |
|
|
10 | (3) |
|
Create Your First SpriteKit Scene |
|
|
13 | (2) |
|
Create Your First Sprite Node |
|
|
15 | (5) |
|
Set Position, Coordinates, and Anchor Points |
|
|
20 | (3) |
|
|
23 | (2) |
|
|
25 | (2) |
|
2 Adding Animation and Movement with Actions |
|
|
27 | (24) |
|
|
27 | (1) |
|
Add the Images Resources for the Player |
|
|
28 | (4) |
|
|
32 | (2) |
|
|
34 | (3) |
|
Control Render Order with Z-Position |
|
|
37 | (4) |
|
Animate the Player with Actions |
|
|
41 | (1) |
|
Use the Animation Extension |
|
|
42 | (1) |
|
Move the Player with Actions |
|
|
43 | (3) |
|
Use Constraints to Limit Movement |
|
|
46 | (1) |
|
Set the Player's Direction Using Scales |
|
|
47 | (2) |
|
Keep the Player's Speed Consistent |
|
|
49 | (1) |
|
|
50 | (1) |
|
3 Chaining Actions and Using Iterative Design |
|
|
51 | (18) |
|
Add Your First Collectible Item |
|
|
51 | (4) |
|
Improve Code with Iterative and Incremental Development |
|
|
55 | (1) |
|
Chain Actions Together to Create a Sequence |
|
|
56 | (2) |
|
Use Actions to Run Code Blocks |
|
|
58 | (3) |
|
Use Level Data to Add Challenging Gameplay |
|
|
61 | (5) |
|
Use Iterative Design to Adjust the Player's Movement |
|
|
66 | (2) |
|
|
68 | (1) |
|
4 Working with Physics and Collision Detection |
|
|
69 | (18) |
|
Run a Playground Physics Simulation |
|
|
69 | (4) |
|
A Closer Look at Physics Bodies |
|
|
73 | (3) |
|
Use Physics Bodies for Collision Detection |
|
|
76 | (3) |
|
Configure Physics Categories |
|
|
79 | (4) |
|
Handle Contact Between Physics Bodies |
|
|
83 | (2) |
|
|
85 | (2) |
|
5 Adding Labels and Working with the Game Loop |
|
|
87 | (26) |
|
Add Labels to Show Current Level and Score |
|
|
87 | (8) |
|
Use Variables to Monitor Game States |
|
|
95 | (10) |
|
Use the Game Loop to Apply Game Logic |
|
|
105 | (4) |
|
Use Attributed Strings with Labels |
|
|
109 | (2) |
|
|
111 | (2) |
|
6 Juicing Your Games with Sound and Effects |
|
|
113 | (30) |
|
|
114 | (3) |
|
|
117 | (2) |
|
Build More Robust Sound Systems |
|
|
119 | (1) |
|
Create an Endless Scrolling Background |
|
|
120 | (5) |
|
Juice Your Game with Particles |
|
|
125 | (5) |
|
Handle Hit-Testing and Touch Events |
|
|
130 | (2) |
|
Squeeze Out a Little More Juice |
|
|
132 | (6) |
|
|
138 | (1) |
|
|
139 | (4) |
|
Part II Use the Scene Editor to Build Games |
|
|
|
7 Building Scenes with the Scene Editor |
|
|
143 | (18) |
|
|
144 | (1) |
|
Clean Up the Default Template |
|
|
145 | (1) |
|
|
146 | (1) |
|
Add Nodes Using the Object Library |
|
|
147 | (10) |
|
Configure the View and Load the Scene |
|
|
157 | (2) |
|
|
159 | (2) |
|
8 Using the Scene Editor to Add Physics |
|
|
161 | (14) |
|
Write Code to Interface with the Scene |
|
|
161 | (3) |
|
Add Physics to the Player |
|
|
164 | (2) |
|
Move the Player Using Physics |
|
|
166 | (4) |
|
Connect the Attack Button |
|
|
170 | (3) |
|
|
173 | (2) |
|
9 Operating the Camera and Using References Nodes |
|
|
175 | (22) |
|
Add a Camera to Track the Player |
|
|
176 | (5) |
|
Use Reference Nodes in Your Scene |
|
|
181 | (3) |
|
Add Support for All Devices and Orientations |
|
|
184 | (3) |
|
Resize the Player Node on Device Rotation |
|
|
187 | (1) |
|
Lock the Location of the On-Screen Controls |
|
|
188 | (6) |
|
Refactor the Code and Clean Up the Project |
|
|
194 | (1) |
|
|
195 | (2) |
|
10 Extending Your Game World with Tile Maps |
|
|
197 | (30) |
|
Create a Bigger World with Tile Map Nodes |
|
|
198 | (6) |
|
|
204 | (2) |
|
|
206 | (3) |
|
|
209 | (5) |
|
|
214 | (4) |
|
Configure Physics Bodies Using User Data |
|
|
218 | (6) |
|
|
224 | (3) |
|
Part III Scale Your Games with GameplayKit |
|
|
|
11 Building Games with Entities and Components |
|
|
227 | (26) |
|
|
229 | (1) |
|
|
230 | (2) |
|
Create Your First Component |
|
|
232 | (7) |
|
|
239 | (2) |
|
Build a Monster Generator |
|
|
241 | (4) |
|
|
245 | (6) |
|
|
251 | (2) |
|
12 Using States and State Machines |
|
|
253 | (24) |
|
|
254 | (2) |
|
Set Up the Player State Machine |
|
|
256 | (1) |
|
Add a New Collectible Component |
|
|
257 | (5) |
|
Configure the Physics Bodies |
|
|
262 | (5) |
|
Add a Physics Contact Extension |
|
|
267 | (4) |
|
Place Collectibles and Doors |
|
|
271 | (3) |
|
Add Code to Destroy Collectibles |
|
|
274 | (1) |
|
|
274 | (3) |
|
13 Planning Routes and Creating Believable AI |
|
|
277 | (24) |
|
Modify the Monster Generator |
|
|
278 | (4) |
|
Use Agents, Goals, and Behaviors |
|
|
282 | (4) |
|
|
286 | (1) |
|
Add an Agent to the Player |
|
|
287 | (1) |
|
|
288 | (1) |
|
Add the Player Agent to the Component System |
|
|
289 | (1) |
|
Add the Monster Entities to the Scene's Entities Array |
|
|
290 | (1) |
|
Update Physics for Monsters and Projectiles |
|
|
290 | (1) |
|
Build a Better Health Component |
|
|
291 | (2) |
|
Add Pathfinding to Your Game |
|
|
293 | (5) |
|
|
298 | (3) |
|
Part IV Enhance the Player's Experience |
|
|
|
14 Using the Action Editor and Enhancing Gameplay |
|
|
301 | (24) |
|
Use the Action Editor to Add Actions |
|
|
301 | (5) |
|
Add the Player's Heads-Up Display |
|
|
306 | (2) |
|
Build Better On-Screen Controls |
|
|
308 | (15) |
|
|
323 | (2) |
|
15 Adding More Scenes and Saving the Game |
|
|
325 | (20) |
|
|
325 | (6) |
|
|
331 | (1) |
|
Load the First Game Scene |
|
|
332 | (1) |
|
Present the Game Over Scene |
|
|
332 | (2) |
|
|
334 | (4) |
|
Exit the Map and Load the Next Scene |
|
|
338 | (2) |
|
Create Additional Game Scenes |
|
|
340 | (1) |
|
Support 3D Spatial Audio Effects |
|
|
341 | (1) |
|
|
342 | (3) |
|
Part V Build Social Games with GameKit |
|
|
|
16 Adding Leaderboards and Achievements |
|
|
345 | (24) |
|
Add Game Center Capability Using Xcode |
|
|
346 | (2) |
|
Use App Store Connect to Add a New App |
|
|
348 | (3) |
|
|
351 | (2) |
|
|
353 | (2) |
|
Create the Game Center Helper |
|
|
355 | (4) |
|
Show the Game Center Dashboard |
|
|
359 | (3) |
|
Report Score to Leaderboard |
|
|
362 | (2) |
|
|
364 | (3) |
|
|
367 | (2) |
|
17 Creating Multiplayer Games with GameKit |
|
|
369 | (24) |
|
Request a Turn-Based Match |
|
|
370 | (3) |
|
Manage Multiplayer Matches |
|
|
373 | (3) |
|
Process Player Turns Using an Event Listener |
|
|
376 | (1) |
|
Use Custom Match Data in Multiplayer Games |
|
|
377 | (2) |
|
Update the Game Scene to Send the Match Data |
|
|
379 | (8) |
|
Use Multiple Devices or Simulators for Testing |
|
|
387 | (3) |
|
|
390 | (3) |
|
Part VI Bonus Content: Monetize Your Games |
|
|
|
18 Using Ads to Increase Revenue |
|
|
393 | (34) |
|
Sign up for AdMob and Register Your App |
|
|
393 | (3) |
|
|
396 | (5) |
|
Download and Integrate the Google Mobile Ads SDK |
|
|
401 | (4) |
|
Add the AdMob Helper File |
|
|
405 | (1) |
|
Use the AdMob Helper for Banner Ads |
|
|
406 | (5) |
|
Add the Continue Game Feature (Player Reward) |
|
|
411 | (6) |
|
Use the AdMob Helper for Rewarded Ads |
|
|
417 | (3) |
|
Create Custom Notifications |
|
|
420 | (4) |
|
Save and Load the Number of Continues |
|
|
424 | (2) |
|
|
426 | (1) |
|
19 Monetizing Your Games with In-App Purchases |
|
|
427 | (32) |
|
Add In-App Purchase Capability Using Xcode |
|
|
427 | (2) |
|
Use App Store Connect to Add a New App |
|
|
429 | (7) |
|
Add In-App Purchase Support to the Project |
|
|
436 | (1) |
|
Configure Products in Xcode |
|
|
437 | (1) |
|
Modify the GameData Class to Store Purchases |
|
|
438 | (1) |
|
Modify the AdMob Helper to Disable Ads |
|
|
439 | (1) |
|
Modify the GameScene Class to Handle Paid Continues |
|
|
440 | (4) |
|
|
444 | (5) |
|
Add the Shop Scene to the Main Game Scene |
|
|
449 | (2) |
|
Interface with StoreKit Using the Store Manager |
|
|
451 | (6) |
|
|
457 | (1) |
|
|
458 | (1) |
Index |
|
459 | |