| Contents at a Glance |
|
iv | |
| About the Authors |
|
xiii | |
| About the Technical Reviewer |
|
xiv | |
| Acknowledgments |
|
xv | |
| Preface |
|
xvi | |
|
|
|
1 | (14) |
|
What's New in the Second Edition? |
|
|
2 | (1) |
|
|
|
3 | (3) |
|
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
4 | (1) |
|
|
|
4 | (1) |
|
|
|
4 | (1) |
|
|
|
5 | (1) |
|
It's Got a Great Community |
|
|
5 | (1) |
|
The Future of the cocos2d-iphone Project |
|
|
6 | (1) |
|
Other cocos2d Game Engines |
|
|
7 | (1) |
|
|
|
8 | (1) |
|
|
|
8 | (1) |
|
|
|
8 | (1) |
|
|
|
8 | (1) |
|
|
|
9 | (2) |
|
What Beginning iOS Game Developers Will Learn |
|
|
10 | (1) |
|
What iOS App Developers Will Learn |
|
|
10 | (1) |
|
What Cocos2d Developers Will Learn |
|
|
11 | (1) |
|
|
|
11 | (3) |
|
Chapter 2 "Getting Started" |
|
|
11 | (1) |
|
|
|
11 | (1) |
|
Chapter 4 "Your First Game" |
|
|
11 | (1) |
|
Chapter 5 "Game Building Blocks" |
|
|
12 | (1) |
|
Chapter 6 "Sprites In-Depth" |
|
|
12 | (1) |
|
Chapter 7 "Scrolling with Joy" |
|
|
12 | (1) |
|
|
|
12 | (1) |
|
Chapter 9 "Particle Effects" |
|
|
12 | (1) |
|
Chapter 10 "Working with Tilemaps" |
|
|
12 | (1) |
|
Chapter 11 "Isometric Tilemaps" |
|
|
12 | (1) |
|
Chapter 12 "Physics Engines" |
|
|
12 | (1) |
|
Chapter 13 "Pinball Game" |
|
|
13 | (1) |
|
|
|
13 | (1) |
|
Chapter 15 "Cocos2d with UIKit Views" |
|
|
13 | (1) |
|
Chapter 16 "Kobold2D Introduction" |
|
|
13 | (1) |
|
|
|
13 | (1) |
|
Where to Get the Book's Source Code? |
|
|
13 | (1) |
|
|
|
14 | (1) |
|
Chapter 2 Getting Started |
|
|
15 | (26) |
|
What You Need to Get Started |
|
|
15 | (6) |
|
|
|
15 | (1) |
|
Register as an iOS Developer |
|
|
16 | (1) |
|
Certificates and Provisioning Profiles |
|
|
16 | (1) |
|
Download and Install the iOS SDK |
|
|
17 | (1) |
|
Download and Install cocos2d |
|
|
17 | (4) |
|
The HelloWorld Application |
|
|
21 | (8) |
|
Locating the HelloWorld Files |
|
|
22 | (1) |
|
|
|
23 | (1) |
|
|
|
23 | (1) |
|
|
|
24 | (5) |
|
Memory Management with cocos2d |
|
|
29 | (3) |
|
|
|
32 | (2) |
|
What Else You Should Know |
|
|
34 | (5) |
|
|
|
34 | (2) |
|
|
|
36 | (1) |
|
|
|
37 | (2) |
|
|
|
39 | (1) |
|
|
|
39 | (2) |
|
|
|
41 | (40) |
|
|
|
41 | (3) |
|
The CCNode Class Hierarchy |
|
|
44 | (2) |
|
|
|
46 | (5) |
|
|
|
46 | (1) |
|
|
|
47 | (1) |
|
|
|
47 | (4) |
|
Director, Scenes, and Layers |
|
|
51 | (13) |
|
|
|
51 | (2) |
|
|
|
53 | (1) |
|
|
|
54 | (1) |
|
Pushing and Popping Scenes |
|
|
55 | (2) |
|
|
|
57 | (2) |
|
|
|
59 | (5) |
|
|
|
64 | (2) |
|
Anchor Points Demystified |
|
|
65 | (1) |
|
|
|
65 | (1) |
|
|
|
66 | (1) |
|
|
|
67 | (2) |
|
|
|
69 | (9) |
|
|
|
70 | (6) |
|
|
|
76 | (2) |
|
A Note on Singletons in cocos2d |
|
|
78 | (2) |
|
|
|
80 | (1) |
|
|
|
80 | (1) |
|
Chapter 4 Your First Game |
|
|
81 | (34) |
|
Step-by-Step Project Setup |
|
|
82 | (5) |
|
|
|
87 | (4) |
|
|
|
91 | (1) |
|
|
|
91 | (1) |
|
|
|
92 | (3) |
|
|
|
95 | (6) |
|
|
|
101 | (2) |
|
|
|
103 | (4) |
|
|
|
103 | (1) |
|
Introducing CCLabelBMFont |
|
|
104 | (1) |
|
Creating Bitmap Fonts with Glyph Designer |
|
|
105 | (2) |
|
|
|
107 | (2) |
|
|
|
109 | (4) |
|
One Universal App or Two Separate Apps? |
|
|
109 | (1) |
|
Porting to iPad with Xcode 3 |
|
|
110 | (1) |
|
Porting to iPad with Xcode 4 |
|
|
111 | (2) |
|
|
|
113 | (2) |
|
Chapter 5 Game Building Blocks |
|
|
115 | (26) |
|
Working with Multiple Scenes |
|
|
115 | (6) |
|
|
|
115 | (3) |
|
Loading Next Paragraph, Please Stand By |
|
|
118 | (3) |
|
Working with Multiple Layers |
|
|
121 | (7) |
|
How to Best Implement Levels |
|
|
126 | (2) |
|
|
|
128 | (1) |
|
Subclassing Game Objects from CCSprite |
|
|
128 | (1) |
|
Composing Game Objects Using CCSprite |
|
|
129 | (5) |
|
Curiously Cool CCNode Classes |
|
|
134 | (6) |
|
|
|
134 | (1) |
|
|
|
135 | (3) |
|
|
|
138 | (1) |
|
|
|
139 | (1) |
|
|
|
140 | (1) |
|
Chapter 6 Sprites In-Depth |
|
|
141 | (28) |
|
|
|
142 | (2) |
|
|
|
144 | (8) |
|
When to Use CCSpriteBatchNode |
|
|
145 | (1) |
|
|
|
146 | (6) |
|
Sprite Animations the Hard Way |
|
|
152 | (2) |
|
Animation Helper Category |
|
|
154 | (2) |
|
Working with Texture Atlases |
|
|
156 | (11) |
|
|
|
156 | (1) |
|
Introducing TexturePacker |
|
|
157 | (1) |
|
Preparing the Project for TexturePacker |
|
|
158 | (1) |
|
Creating a Texture Atlas with TexturePacker |
|
|
159 | (4) |
|
Using the Texture Atlas with cocos2d |
|
|
163 | (2) |
|
Updating the CCAnimation Helper Category |
|
|
165 | (1) |
|
All into One and One for All |
|
|
166 | (1) |
|
|
|
167 | (2) |
|
Chapter 7 Scrolling with Joy |
|
|
169 | (26) |
|
Advanced Parallax Scrolling |
|
|
169 | (13) |
|
Creating the Background As Stripes |
|
|
169 | (3) |
|
Re-creating the Background in Code |
|
|
172 | (2) |
|
Moving the ParallaxBackground |
|
|
174 | (1) |
|
|
|
175 | (3) |
|
Scrolling to Infinity and Beyond |
|
|
178 | (2) |
|
|
|
180 | (1) |
|
|
|
181 | (1) |
|
|
|
182 | (11) |
|
|
|
183 | (1) |
|
|
|
184 | (1) |
|
|
|
185 | (2) |
|
|
|
187 | (3) |
|
|
|
190 | (3) |
|
|
|
193 | (1) |
|
|
|
193 | (2) |
|
|
|
195 | (22) |
|
Adding the BulletCache Class |
|
|
195 | (4) |
|
|
|
199 | (2) |
|
The Entity Class Hierarchy |
|
|
201 | (10) |
|
|
|
201 | (4) |
|
|
|
205 | (4) |
|
|
|
209 | (2) |
|
|
|
211 | (2) |
|
|
|
213 | (2) |
|
|
|
215 | (2) |
|
Chapter 9 Particle Effects |
|
|
217 | (26) |
|
|
|
217 | (4) |
|
Creating a Particle Effect the Hard Way |
|
|
221 | (13) |
|
Subclassing CCParticleSystem: Point or Quad? |
|
|
222 | (2) |
|
CCParticleSystem Properties |
|
|
224 | (10) |
|
|
|
234 | (6) |
|
Introducing the Particle Designer |
|
|
234 | (3) |
|
Using Particle Designer Effects |
|
|
237 | (2) |
|
|
|
239 | (1) |
|
Shoot `em Up with Particle Effects |
|
|
240 | (2) |
|
|
|
242 | (1) |
|
Chapter 10 Working with Tilemaps |
|
|
243 | (26) |
|
|
|
243 | (4) |
|
Preparing Images with TexturePacker |
|
|
247 | (1) |
|
|
|
248 | (6) |
|
|
|
248 | (3) |
|
|
|
251 | (3) |
|
Using Orthogonal Tilemaps with Cocos2d |
|
|
254 | (12) |
|
|
|
257 | (3) |
|
An Exercise in Optimization and Readability |
|
|
260 | (1) |
|
Working with the Object Layer |
|
|
260 | (2) |
|
Drawing the Object Layer Rectangles |
|
|
262 | (3) |
|
|
|
265 | (1) |
|
|
|
266 | (3) |
|
Chapter 11 Isometric Tilemaps |
|
|
269 | (28) |
|
Designing Isometric Tile Graphics |
|
|
270 | (3) |
|
Isometric Tilemap Editing with Tiled |
|
|
273 | (5) |
|
Creating a New Isometric Tilemap |
|
|
273 | (3) |
|
Creating a New Isometric Tileset |
|
|
276 | (1) |
|
Laying Down Some Ground Rules |
|
|
276 | (2) |
|
Isometric Game Programming |
|
|
278 | (17) |
|
Loading the Isometric Tilemap in Cocos2d |
|
|
278 | (1) |
|
Setup Cocos2d for Isometric Tilemaps |
|
|
279 | (2) |
|
Locating an Isometric Tile |
|
|
281 | (2) |
|
Scrolling the Isometric Tilemap |
|
|
283 | (1) |
|
This World Deserves a Better End |
|
|
284 | (3) |
|
Adding a Movable Player Character |
|
|
287 | (8) |
|
Adding More Content to the Game |
|
|
295 | (1) |
|
|
|
295 | (2) |
|
Chapter 12 Physics Engines |
|
|
297 | (24) |
|
Basic Concepts of Physics Engines |
|
|
297 | (1) |
|
Limitations of Physics Engines |
|
|
298 | (1) |
|
The Showdown: Box2D vs. Chipmunk |
|
|
299 | (1) |
|
|
|
300 | (11) |
|
The World According to Box2D |
|
|
301 | (1) |
|
Restricting Movement to the Screen |
|
|
302 | (2) |
|
|
|
304 | (1) |
|
Adding Boxes to the Box2D World |
|
|
305 | (1) |
|
Connecting Sprites with Bodies |
|
|
306 | (2) |
|
|
|
308 | (2) |
|
|
|
310 | (1) |
|
|
|
311 | (9) |
|
|
|
311 | (1) |
|
|
|
312 | (1) |
|
|
|
313 | (1) |
|
Adding Ticky-Tacky Little Boxes |
|
|
314 | (2) |
|
Updating the Boxes' Sprites |
|
|
316 | (1) |
|
A Chipmunk Collision Course |
|
|
317 | (2) |
|
|
|
319 | (1) |
|
|
|
320 | (1) |
|
|
|
321 | (44) |
|
Shapes: Convex and Counterclockwise |
|
|
322 | (1) |
|
Working with PhysicsEditor |
|
|
323 | (10) |
|
Defining the Plunger Shape |
|
|
325 | (3) |
|
Defining the Table Shapes |
|
|
328 | (3) |
|
|
|
331 | (1) |
|
Defining the Bumper and Ball |
|
|
332 | (1) |
|
|
|
333 | (1) |
|
Programming the Pinball Game |
|
|
333 | (30) |
|
|
|
333 | (5) |
|
Creating the Pinball Table |
|
|
338 | (5) |
|
|
|
343 | (1) |
|
|
|
344 | (3) |
|
|
|
347 | (3) |
|
|
|
350 | (1) |
|
|
|
351 | (9) |
|
|
|
360 | (3) |
|
|
|
363 | (2) |
|
|
|
365 | (36) |
|
|
|
365 | (8) |
|
Creating Your App in iTunes Connect |
|
|
366 | (1) |
|
Setting Up Leaderboards and Achievements |
|
|
367 | (1) |
|
Creating a Cocos2d Xcode Project |
|
|
367 | (1) |
|
Configuring the Xcode Project |
|
|
368 | (4) |
|
Game Center Setup Summary |
|
|
372 | (1) |
|
|
|
373 | (27) |
|
The GameKitHelper Delegate |
|
|
373 | (1) |
|
Checking for Game Center Availability |
|
|
374 | (1) |
|
Authenticating the Local Player |
|
|
375 | (3) |
|
|
|
378 | (2) |
|
Receiving the Local Player's Friend List |
|
|
380 | (2) |
|
|
|
382 | (5) |
|
|
|
387 | (5) |
|
|
|
392 | (4) |
|
Sending and Receiving Data |
|
|
396 | (4) |
|
|
|
400 | (1) |
|
Chapter 15 Cocos2d with UIKit Views |
|
|
401 | (38) |
|
|
|
401 | (1) |
|
Using Cocoa Touch and cocos2d Together |
|
|
402 | (3) |
|
Why Mix Cocoa Touch with cocos2d? |
|
|
402 | (1) |
|
Limitations of Mixing Cocoa Touch with cocos2d |
|
|
403 | (1) |
|
How Is Cocoa Touch Different from cocos2d? |
|
|
404 | (1) |
|
Alert: Your First UIKit View in cocos2d |
|
|
405 | (3) |
|
Embedding UIKit Views in a cocos2d App |
|
|
408 | (19) |
|
Adding Views in Front of the cocos2d View |
|
|
408 | (2) |
|
Skinning the UITextField with a UIImage |
|
|
410 | (2) |
|
Adding Views Behind the cocos2d View |
|
|
412 | (7) |
|
Adding Views Designed with Interface Builder |
|
|
419 | (3) |
|
Orientation Course on Autorotation |
|
|
422 | (5) |
|
Embedding the cocos2d View in Cocoa Touch Apps |
|
|
427 | (10) |
|
Creating a View-Based Application Project with cocos2d |
|
|
427 | (3) |
|
Designing the User Interface of the Hybrid App |
|
|
430 | (2) |
|
Start Your cocos2d Engine |
|
|
432 | (2) |
|
Stop the cocos2d Engine and Restart It |
|
|
434 | (2) |
|
|
|
436 | (1) |
|
|
|
437 | (2) |
|
Chapter 16 KoboId2D Introduction |
|
|
439 | (28) |
|
Benefits of Using KoboId2D |
|
|
440 | (2) |
|
|
|
440 | (1) |
|
|
|
440 | (1) |
|
KoboId2D Is Easy to Upgrade |
|
|
440 | (1) |
|
KoboId2D Provides "Lib Service" |
|
|
441 | (1) |
|
KoboId2D Takes Cross-Platform to Heart |
|
|
442 | (1) |
|
|
|
442 | (2) |
|
The Hello KoboId2D Template Project |
|
|
444 | (11) |
|
The Hello World Project Files |
|
|
445 | (1) |
|
How KoboId2D Launches an App |
|
|
446 | (4) |
|
The Hello KoboId2D Scene and Layer |
|
|
450 | (4) |
|
Running Hello World with iSimulate |
|
|
454 | (1) |
|
Doodle Drop for Mac with KKInput |
|
|
455 | (2) |
|
Entering the Third Dimension with cocos3d |
|
|
457 | (8) |
|
Changes to the AppDelegate Class |
|
|
458 | (4) |
|
The World According to cocos3d |
|
|
462 | (2) |
|
Adding cocos3d to an Existing KoboId2D Project |
|
|
464 | (1) |
|
|
|
465 | (2) |
|
Chapter 17 Out of the Ordinary |
|
|
467 | (210) |
|
Additional Resources for Learning and Working |
|
|
468 | (14) |
|
|
|
468 | (2) |
|
Source Code Projects to Benefit From |
|
|
470 | (6) |
|
|
|
476 | (1) |
|
|
|
477 | (1) |
|
|
|
478 | (4) |
|
The Business of Making Games |
|
|
482 | (12) |
|
|
|
482 | (2) |
|
|
|
484 | (1) |
|
Finding Free Art and Audio |
|
|
484 | (1) |
|
Finding the Tools of the Trade |
|
|
485 | (1) |
|
|
|
485 | (4) |
|
Engaging Players for More Revenue |
|
|
489 | (5) |
|
|
|
494 | (183) |
| Index |
|
677 | |