About the Authors |
|
xiii | |
About the Technical Reviewer |
|
xv | |
Acknowledgments |
|
xvii | |
Introduction |
|
xix | |
|
Part I Swift and Sprite Kit |
|
|
1 | (140) |
|
Chapter 1 Setting Up Your Game Scene and Adding Your First Sprites |
|
|
3 | (16) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
Creating a Swift Sprite Kit Project |
|
|
4 | (2) |
|
|
6 | (6) |
|
The GameViewController Class |
|
|
9 | (2) |
|
|
11 | (1) |
|
Adding a Background and Player Sprite |
|
|
12 | (5) |
|
|
17 | (2) |
|
Chapter 2 Sprite Kit Scenes and SKNode Positioning |
|
|
19 | (14) |
|
|
19 | (8) |
|
The SKScene Rendering Loop |
|
|
20 | (2) |
|
Building the Scene's Node Tree |
|
|
22 | (5) |
|
Looking at SKSpriteNode Coordinates and Anchor Points |
|
|
27 | (5) |
|
|
28 | (2) |
|
|
30 | (2) |
|
|
32 | (1) |
|
Chapter 3 Adding Physics and Collision Detection to Your Game |
|
|
33 | (14) |
|
What Is an SKPhysicsBody? |
|
|
33 | (1) |
|
Adding Physics to Your Game World |
|
|
34 | (1) |
|
Applying Forces to SKPhysicsBody |
|
|
35 | (3) |
|
Adding Collision Detection to Your SKNode |
|
|
38 | (7) |
|
Adding a Node to Collide Into |
|
|
38 | (1) |
|
Adding Collision Detection |
|
|
39 | (3) |
|
Removing the Orb When You Receive a Contact Message |
|
|
42 | (3) |
|
|
45 | (2) |
|
Chapter 4 Adding Scene Scrolling and Game Control |
|
|
47 | (12) |
|
Reorganizing the GameScene |
|
|
47 | (2) |
|
Adding More Orbs to the Scene |
|
|
49 | (3) |
|
|
52 | (2) |
|
Controlling Player Movement with the Accelerometer |
|
|
54 | (4) |
|
|
58 | (1) |
|
Chapter 5 Adding Actions and Animations |
|
|
59 | (20) |
|
Refactoring the Orb Node Layout One Last Time |
|
|
59 | (4) |
|
|
63 | (8) |
|
Using Actions to Move Nodes in the Scene |
|
|
64 | (5) |
|
Using SKActions to Animate Sprites |
|
|
69 | (2) |
|
Adding Some Additional Bling to the GameScene |
|
|
71 | (6) |
|
|
77 | (2) |
|
Chapter 6 Adding Particle Effects to Your Game with Emitter Nodes |
|
|
79 | (18) |
|
|
80 | (10) |
|
Using Particle Emitter Templates |
|
|
82 | (1) |
|
Creating a Particle Emitter |
|
|
82 | (8) |
|
Adding an Exhaust Trail to the Player |
|
|
90 | (5) |
|
|
95 | (2) |
|
Chapter 7 Adding Points and Sound |
|
|
97 | (16) |
|
|
97 | (13) |
|
Changing the Horizontal Alignment of the Label Node |
|
|
99 | (2) |
|
Changing the Vertical Alignment of the Label Node |
|
|
101 | (4) |
|
Adding Scoring to the Game |
|
|
105 | (3) |
|
Adding an Impulse Counter to the Game |
|
|
108 | (2) |
|
Adding Simple Sounds to the Game |
|
|
110 | (2) |
|
|
112 | (1) |
|
Chapter 8 Transitioning Between Scenes |
|
|
113 | (14) |
|
Transitioning Between Scenes Using SKTransitions |
|
|
113 | (3) |
|
Pausing Scenes During a Transition |
|
|
115 | (1) |
|
Detecting When a New Scene Is Presented |
|
|
115 | (1) |
|
Adding a New Scene to SuperSpaceMan |
|
|
116 | (9) |
|
|
118 | (7) |
|
|
125 | (2) |
|
Chapter 9 Sprite Kit Best Practices |
|
|
127 | (14) |
|
Creating Your Own Nodes Through Subclassing |
|
|
127 | (5) |
|
|
132 | (3) |
|
Externalizing Your Game Data |
|
|
135 | (2) |
|
Keeping Your Node Tree Pruned |
|
|
137 | (2) |
|
|
139 | (2) |
|
Part II Swift and Scene Kit |
|
|
141 | (78) |
|
Chapter 10 Creating Your First Scene Kit Project |
|
|
143 | (12) |
|
|
143 | (3) |
|
|
144 | (1) |
|
|
145 | (1) |
|
Creating the Scene Kit Project |
|
|
146 | (2) |
|
Wiring Up and Building a Scene |
|
|
148 | (1) |
|
|
148 | (6) |
|
|
149 | (1) |
|
|
150 | (4) |
|
|
154 | (1) |
|
Chapter 11 Building the Scene |
|
|
155 | (14) |
|
|
155 | (2) |
|
|
157 | (4) |
|
|
160 | (1) |
|
Scene Kit's Built-in Model Classes |
|
|
161 | (2) |
|
|
161 | (2) |
|
|
163 | (4) |
|
|
167 | (1) |
|
|
167 | (1) |
|
|
168 | (1) |
|
Chapter 12 Lighting, Camera, and Material Effects in Scene Kit |
|
|
169 | (12) |
|
|
169 | (2) |
|
|
171 | (9) |
|
Appling Materials to Your Obstacles |
|
|
174 | (2) |
|
Adding Textures to Collada Files |
|
|
176 | (3) |
|
|
179 | (1) |
|
|
180 | (1) |
|
Chapter 13 Animating Your Models |
|
|
181 | (8) |
|
|
181 | (1) |
|
|
182 | (4) |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
186 | (2) |
|
|
188 | (1) |
|
Chapter 14 Hit Testing and Collision Detection |
|
|
189 | (12) |
|
GameView: Moving the Hero |
|
|
189 | (5) |
|
Writing the Callback Delegate Function |
|
|
192 | (1) |
|
|
193 | (1) |
|
CoreMotion Framework Introduction |
|
|
194 | (1) |
|
|
195 | (1) |
|
|
196 | (4) |
|
|
200 | (1) |
|
Chapter 15 Using Sprite Kit with a Scene Kit Scene |
|
|
201 | (10) |
|
|
201 | (2) |
|
Hooking Up the Controller to the Overlay |
|
|
203 | (3) |
|
|
206 | (2) |
|
|
208 | (1) |
|
|
209 | (2) |
|
Chapter 16 Advanced Topics and Tips |
|
|
211 | (8) |
|
|
211 | (1) |
|
Vectors and Various Math Operations |
|
|
211 | (2) |
|
|
213 | (5) |
|
|
218 | (1) |
|
Appendix A The Swift Programming Language |
|
|
219 | (26) |
|
|
220 | (1) |
|
|
221 | (5) |
|
|
222 | (1) |
|
|
222 | (2) |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
226 | (7) |
|
|
227 | (1) |
|
|
227 | (1) |
|
|
228 | (1) |
|
Functions Returning Functions |
|
|
229 | (2) |
|
Passing Functions As Parameters |
|
|
231 | (1) |
|
|
232 | (1) |
|
|
233 | (1) |
|
|
234 | (4) |
|
|
236 | (1) |
|
|
237 | (1) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
240 | (2) |
|
|
242 | (1) |
|
|
243 | (2) |
Index |
|
245 | |