Contents at a Glance |
|
iv | |
About the Author |
|
xii | |
About the Technical Reviewer |
|
xiii | |
Acknowledgments |
|
xiv | |
Preface |
|
xv | |
|
|
1 | (12) |
|
Why Use cocos2d for iPhone? |
|
|
2 | (3) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
It's Got a Great Community |
|
|
4 | (1) |
|
Important cocos2d Tidbits |
|
|
5 | (1) |
|
|
5 | (1) |
|
Porting to Other Platforms |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (2) |
|
What Beginning iOS Game Developers Will Learn |
|
|
7 | (1) |
|
What iPhone App Developers Will Learn |
|
|
8 | (1) |
|
What Cocos2d Developers Will Learn |
|
|
8 | (1) |
|
|
9 | (2) |
|
Chapter 2 Getting Started |
|
|
9 | (1) |
|
|
9 | (1) |
|
Chapter 4 Your First Game |
|
|
9 | (1) |
|
Chapter 5 Game Building Blocks |
|
|
9 | (1) |
|
Chapter 6 Sprites In-Depth |
|
|
9 | (1) |
|
Chapter 7 Scrolling with Joy |
|
|
9 | (1) |
|
|
10 | (1) |
|
Chapter 9 Particle Effects |
|
|
10 | (1) |
|
Chapter 10 Working with Tilemaps |
|
|
10 | (1) |
|
Chapter 11 Isometric Tilemaps |
|
|
10 | (1) |
|
Chapter 12 Physics Engines |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (2) |
|
Chapter 2 Getting Started |
|
|
13 | (26) |
|
What You Need to Get Started |
|
|
13 | (6) |
|
|
13 | (1) |
|
Register as iOS Developer |
|
|
14 | (1) |
|
Certificates & Provisioning Profiles |
|
|
14 | (1) |
|
Download & Install the iPhone SDK |
|
|
14 | (1) |
|
Download & Install cosos2d |
|
|
15 | (4) |
|
The HelloWorld Application |
|
|
19 | (8) |
|
Locating the HelloWorld files |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (5) |
|
Memory Management with cocos2d |
|
|
27 | (2) |
|
|
29 | (2) |
|
What Else You Should Know |
|
|
31 | (5) |
|
|
32 | (1) |
|
|
33 | (2) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (3) |
|
|
39 | (26) |
|
|
39 | (2) |
|
|
41 | (1) |
|
|
41 | (2) |
|
The CCNode Class Hierarchy |
|
|
43 | (1) |
|
|
43 | (5) |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (3) |
|
|
48 | (8) |
|
|
49 | (1) |
|
|
49 | (1) |
|
Pushing and Popping Scenes |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
52 | (4) |
|
|
56 | (1) |
|
Anchor Points Demystified |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (1) |
|
|
58 | (2) |
|
|
60 | (3) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
63 | (2) |
|
Chapter 4 Your First Game |
|
|
65 | (28) |
|
Step-By-Step Project Setup |
|
|
66 | (5) |
|
|
71 | (3) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
75 | (3) |
|
|
78 | (6) |
|
|
84 | (1) |
|
|
85 | (1) |
|
Introducing CCBitmapFontAtlas and Hiero |
|
|
86 | (3) |
|
|
89 | (1) |
|
|
90 | (1) |
|
|
91 | (2) |
|
Chapter 5 Game Building Blocks |
|
|
93 | (24) |
|
Working with Multiple Scenes |
|
|
93 | (5) |
|
|
93 | (2) |
|
Loading Next Paragraph, Please Stand By |
|
|
95 | (3) |
|
Working with Multiple Layers |
|
|
98 | (7) |
|
How to Best Implement Levels |
|
|
103 | (1) |
|
|
104 | (1) |
|
Subclassing Game Objects from CCSprite |
|
|
105 | (1) |
|
Composing Game Objects using CCSprite |
|
|
106 | (6) |
|
Curiously Cool CCNode Classes |
|
|
112 | (4) |
|
|
112 | (1) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
Chapter 6 Sprites In-Depth |
|
|
117 | (24) |
|
|
117 | (7) |
|
When to Use the CCSpriteBatchNode |
|
|
119 | (1) |
|
|
119 | (5) |
|
Sprite Animations the Hard Way |
|
|
124 | (2) |
|
Animation Helper Category |
|
|
126 | (2) |
|
Working with Texture Atlases |
|
|
128 | (10) |
|
|
128 | (1) |
|
|
129 | (1) |
|
Creating a Texture Atlas with Zwoptex Desktop |
|
|
130 | (4) |
|
Using the Texture Atlas with Cocos2d |
|
|
134 | (2) |
|
Updating the CCAnimation Helper Category |
|
|
136 | (1) |
|
All into One and One for All |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
139 | (2) |
|
Chapter 7 Scrolling with Joy |
|
|
141 | (26) |
|
Advanced Parallax Scrolling |
|
|
141 | (12) |
|
Creating the Background As Stripes |
|
|
141 | (3) |
|
Re-creating the Background in Code |
|
|
144 | (2) |
|
Moving the ParallaxBackground |
|
|
146 | (1) |
|
|
147 | (2) |
|
Scrolling to Infinity and Beyond |
|
|
149 | (2) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (11) |
|
|
154 | (1) |
|
|
155 | (1) |
|
|
156 | (2) |
|
|
158 | (2) |
|
|
160 | (4) |
|
|
164 | (1) |
|
An Alternative: GP Joystick |
|
|
164 | (1) |
|
|
164 | (3) |
|
|
167 | (22) |
|
Adding the BulletCache Class |
|
|
167 | (4) |
|
|
171 | (2) |
|
The Entity Class Hierarchy |
|
|
173 | (10) |
|
|
174 | (1) |
|
|
174 | (3) |
|
|
177 | (6) |
|
|
183 | (2) |
|
|
185 | (3) |
|
|
188 | (1) |
|
Chapter 9 Particle Effects |
|
|
189 | (22) |
|
|
189 | (3) |
|
Creating a Particle Effect the Hard Way |
|
|
192 | (10) |
|
|
195 | (1) |
|
|
195 | (1) |
|
|
196 | (1) |
|
|
196 | (3) |
|
|
199 | (1) |
|
|
199 | (1) |
|
|
199 | (1) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
202 | (1) |
|
Introducing the Particle Designer |
|
|
202 | (6) |
|
Using Particle Designer Effects |
|
|
205 | (2) |
|
|
207 | (1) |
|
Shoot 'em Up with Particle Effects |
|
|
208 | (2) |
|
|
210 | (1) |
|
Chapter 10 Working with Tilemaps |
|
|
211 | (24) |
|
|
211 | (3) |
|
Preparing Images with Zwoptex |
|
|
214 | (2) |
|
|
216 | (5) |
|
|
216 | (2) |
|
|
218 | (3) |
|
Using Orthogonal Tilemaps with Cocos2d |
|
|
221 | (12) |
|
|
224 | (3) |
|
An Exercise in Optimization and Readability |
|
|
227 | (1) |
|
Working with the Object Layer |
|
|
227 | (2) |
|
Drawing the Object Layer Rectangles |
|
|
229 | (3) |
|
|
232 | (1) |
|
|
233 | (2) |
|
Chapter 11 Isometric Tilemaps |
|
|
235 | (28) |
|
Designing Isometric Tile Graphics |
|
|
236 | (4) |
|
Isometric Tilemap Editing with Tiled |
|
|
240 | (4) |
|
Creating a New Isometric Tilemap |
|
|
240 | (1) |
|
Creating a New Isometric Tileset |
|
|
241 | (1) |
|
Laying Down Some Ground Rules |
|
|
242 | (2) |
|
Isometric Game Programming |
|
|
244 | (16) |
|
Loading the Isometric Tilemap in Cocos2d |
|
|
244 | (1) |
|
Setup Cocos2d for Isometric Tilemaps |
|
|
244 | (2) |
|
Locating an Isometric Tile |
|
|
246 | (2) |
|
Scrolling the Isometric Tilemap |
|
|
248 | (1) |
|
This World Deserves a Better End |
|
|
249 | (4) |
|
Adding a Movable Player Character |
|
|
253 | (7) |
|
Adding More Content to the Game |
|
|
260 | (1) |
|
|
261 | (2) |
|
Chapter 12 Physics Engines |
|
|
263 | (24) |
|
Basic Concepts of Physics Engines |
|
|
263 | (1) |
|
Limitations of Physics Engines |
|
|
264 | (1) |
|
The Showdown: Box2D vs. Chipmunk |
|
|
264 | (1) |
|
|
265 | (12) |
|
The World According to Box2D |
|
|
266 | (2) |
|
Restricting Movement to the Screen |
|
|
268 | (2) |
|
|
270 | (1) |
|
Adding Boxes to the Box2D World |
|
|
271 | (1) |
|
Connecting Sprites with Bodies |
|
|
272 | (1) |
|
|
273 | (3) |
|
|
276 | (1) |
|
|
277 | (9) |
|
|
277 | (1) |
|
|
278 | (1) |
|
|
279 | (1) |
|
Adding Ticky-Tacky Little Boxes |
|
|
280 | (2) |
|
Updating the Boxes' Sprites |
|
|
282 | (1) |
|
A Chipmunk Collision Course |
|
|
283 | (2) |
|
|
285 | (1) |
|
|
286 | (1) |
|
|
287 | (28) |
|
Shapes: Convex and Counterclockwise |
|
|
288 | (1) |
|
Working with VertexHelper |
|
|
289 | (2) |
|
Creating the Pinball Table |
|
|
291 | (6) |
|
|
296 | (1) |
|
|
297 | (17) |
|
|
298 | (3) |
|
|
301 | (4) |
|
|
305 | (1) |
|
|
306 | (4) |
|
|
310 | (4) |
|
|
314 | (1) |
|
|
315 | (32) |
|
|
315 | (8) |
|
Creating Your App in iTunes Connect |
|
|
316 | (1) |
|
Setting Up Leaderboards and Achievements |
|
|
317 | (1) |
|
Creating a Cocos2d Xcode Project |
|
|
317 | (1) |
|
Configuring the Xcode Project |
|
|
318 | (4) |
|
|
322 | (1) |
|
|
323 | (23) |
|
The GameKitHelper Delegate |
|
|
323 | (1) |
|
Checking for Game Center Availability |
|
|
324 | (1) |
|
Authenticating the Local Player |
|
|
325 | (3) |
|
|
328 | (2) |
|
Receiving the Local Player's Friend List |
|
|
330 | (2) |
|
|
332 | (4) |
|
|
336 | (5) |
|
|
341 | (5) |
|
|
346 | (1) |
|
Chapter 15 Out of the Ordinary |
|
|
347 | (18) |
|
|
348 | (3) |
|
|
348 | (1) |
|
|
349 | (1) |
|
|
350 | (1) |
|
Push Notification Providers |
|
|
351 | (1) |
|
Source Code Projects to Benefit From |
|
|
351 | (2) |
|
|
351 | (1) |
|
|
352 | (1) |
|
|
352 | (1) |
|
Line-Drawing Game Starterkit |
|
|
353 | (1) |
|
|
353 | (2) |
|
|
355 | (1) |
|
|
356 | (1) |
|
Finding Free Art and Audio |
|
|
357 | (1) |
|
Finding the Tools of the Trade |
|
|
357 | (1) |
|
|
358 | (3) |
|
Marketing Your Game and Your Self |
|
|
358 | (2) |
|
Public Relations and Press Releases |
|
|
360 | (1) |
|
|
361 | (2) |
|
|
361 | (1) |
|
|
362 | (1) |
|
|
362 | (1) |
|
|
363 | (1) |
|
|
363 | (2) |
Index |
|
365 | |