Preface |
|
xiii | |
1 Introduction-Let There Be...Games! |
|
1 | (8) |
|
1.1 Why Program Games for the iPhone? |
|
|
1 | (1) |
|
1.2 Welcome to the World of Apple-the iPhone Phenomenon |
|
|
2 | (2) |
|
1.3 The iPhone Family-Specifications |
|
|
4 | (1) |
|
1.4 All Beginnings Are Easy |
|
|
5 | (4) |
|
1.4.1 Downloading the Examples in This Book |
|
|
6 | (1) |
|
|
7 | (2) |
2 The Basics-How Does It All Work? |
|
9 | (40) |
|
2.1 The Source of Power-The iOS Dev Center |
|
|
9 | (1) |
|
2.2 Downloading and Installing Xcode and the iOS SDK |
|
|
9 | (2) |
|
2.2.1 Download and Try Out Example Codes from Apple |
|
|
10 | (1) |
|
2.2.2 Using the iPhone Simulator |
|
|
10 | (1) |
|
2.3 Using Xcode Templates |
|
|
11 | (1) |
|
2.4 Hello World with Console Output |
|
|
11 | (6) |
|
2.4.1 Delegates and the Main() Method |
|
|
12 | (2) |
|
2.4.2 Program Flow, Frameworks, and the App File |
|
|
14 | (1) |
|
2.4.3 The Structure of the Delegate Class and Implementation of Console Output |
|
|
14 | (3) |
|
2.5 Hello World with Text in a View Instance |
|
|
17 | (3) |
|
2.6 Who's Afraid of Objective-C? A 15-Minute Crash Course |
|
|
20 | (7) |
|
2.6.1 Help Getting Started |
|
|
21 | (1) |
|
2.6.2 How Objective-C Was Born |
|
|
21 | (1) |
|
|
21 | (1) |
|
2.6.4 Declaration of Classes |
|
|
22 | (1) |
|
|
23 | (1) |
|
2.6.6 Instance and Class Methods |
|
|
24 | (1) |
|
|
25 | (2) |
|
2.6.8 Automatic Reference Counting (ARC) |
|
|
27 | (1) |
|
2.7 The Life Cycle of an App |
|
|
27 | (3) |
|
2.8 Broad Support: Universal Apps |
|
|
30 | (15) |
|
2.8.1 What Advantages Does the iPad Offer for Game Development? |
|
|
32 | (1) |
|
2.8.2 Platform-Independent Programming |
|
|
32 | (1) |
|
|
33 | (1) |
|
2.8.4 Example: Developing a Universal App |
|
|
34 | (6) |
|
2.8.5 Turning Off the Status Bar |
|
|
40 | (1) |
|
2.8.6 Adding Resources: App Icons and Splash Images |
|
|
41 | (1) |
|
2.8.7 Setting the App Name |
|
|
42 | (1) |
|
2.8.8 Query Resolution and Text Output |
|
|
43 | (2) |
|
2.9 Support for Retina Displays |
|
|
45 | (4) |
|
2.9.1 How Do I Support Retina Resolution? |
|
|
46 | (1) |
|
2.9.2 Testing with the Retina Emulator |
|
|
47 | (2) |
3 Game Development From 0 to 60 in No Time Flat |
|
49 | (92) |
|
|
49 | (2) |
|
3.1.1 All Right Then, but How Are Games Actually Made? |
|
|
49 | (2) |
|
3.1.2 What Do I Need to Know? Useful Questions |
|
|
51 | (1) |
|
3.2 The Two-Dimensional (2D) Coordinate System |
|
|
51 | (2) |
|
3.3 Setting Up an Example Project |
|
|
53 | (3) |
|
3.3.1 How Do I Create Global Variables? |
|
|
55 | (1) |
|
3.4 Drawing Class: Rendering Simple Forms |
|
|
56 | (5) |
|
3.4.1 How Do I Draw Lines? |
|
|
56 | (1) |
|
3.4.2 Specifying the Color and Transparency |
|
|
57 | (1) |
|
|
57 | (1) |
|
3.4.4 Random Numbers and Abstract Art |
|
|
58 | (1) |
|
3.4.5 How Do I Draw Rectangles? |
|
|
59 | (1) |
|
3.4.6 How Do I Draw Circles? |
|
|
60 | (1) |
|
3.4.7 Text Output (Fonts and Type Size) |
|
|
61 | (1) |
|
3.5 Integrating, Loading, and Displaying Images |
|
|
61 | (7) |
|
3.5.1 One, Two, Three, Four: Can We Make a Lot More? |
|
|
64 | (4) |
|
3.6 The Game Loop and Frames-Bringing Pictures to Life |
|
|
68 | (5) |
|
3.7 Clipping and Animation |
|
|
73 | (11) |
|
|
76 | (1) |
|
|
77 | (5) |
|
3.7.3 Organization Is Everything: Arrays |
|
|
82 | (2) |
|
3.8 Collision Control, Please! |
|
|
84 | (9) |
|
3.8.1 Distance between Two Points |
|
|
90 | (2) |
|
3.8.2 Collision Checking with Circles |
|
|
92 | (1) |
|
|
93 | (9) |
|
3.9.1 Querying the Motion Sensor |
|
|
99 | (3) |
|
3.10 All Together Now: GameManager and Sprite Management |
|
|
102 | (21) |
|
|
103 | (1) |
|
|
103 | (1) |
|
|
103 | (1) |
|
|
104 | (1) |
|
3.10.5 HUD (Head-up Display) |
|
|
104 | (1) |
|
|
104 | (4) |
|
|
108 | (1) |
|
3.10.8 Resource Management |
|
|
109 | (2) |
|
|
111 | (4) |
|
3.10.10 One-Time Animation Sequences |
|
|
115 | (3) |
|
3.10.11 Finite-State Machines: Organization Made Easy |
|
|
118 | (1) |
|
|
119 | (3) |
|
|
122 | (1) |
|
3.11 Zappp, Brzzz, B000m, Pennng! Background Music and Sound Effects |
|
|
123 | (13) |
|
3.11.1 Preparations: Integrating the Framework |
|
|
123 | (1) |
|
3.11.2 How to Use the AVAudioPlayer |
|
|
124 | (1) |
|
3.11.3 Polyphony and Sound Formats |
|
|
125 | (1) |
|
3.11.4 Where Do I Find Suitable Sounds? |
|
|
126 | (1) |
|
3.11.5 Integrating Sounds into a Game |
|
|
127 | (9) |
|
|
136 | (5) |
|
3.12.1 Example: High Scores |
|
|
138 | (3) |
4 Making Connections: Multiplayer Games with Game Kit and Game Center |
|
141 | (18) |
|
|
141 | (2) |
|
4.2 Setting Up iTunes Connect |
|
|
143 | (4) |
|
4.3 The Road to the Game Center Test App |
|
|
147 | (8) |
|
|
149 | (1) |
|
4.3.2 Blocks as Callback Handler |
|
|
150 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
4.3.5 Integrating the GCHelper into Your Own App |
|
|
153 | (2) |
|
|
155 | (4) |
|
4.4.1 Matchmaking and Sessions |
|
|
155 | (4) |
5 OpenGL ES: Turbocharged! |
|
159 | (78) |
|
|
159 | (1) |
|
5.2 What Is OpenGL ES, and How Is It Constructed? |
|
|
160 | (2) |
|
5.2.1 Which Version of OpenGL ES Should I Choose? |
|
|
161 | (1) |
|
5.3 OpenGL ES: Basic Questions |
|
|
162 | (1) |
|
5.4 Properly Integrating OpenGL ES |
|
|
163 | (6) |
|
5.4.1 What Is Up with the Three Buffers? |
|
|
165 | (4) |
|
5.5 The OpenGL Coordinate System |
|
|
169 | (3) |
|
|
171 | (1) |
|
5.6 Simple Drawing Operations |
|
|
172 | (5) |
|
5.7 Digression: Math Plotter |
|
|
177 | (2) |
|
5.8 And Pictures? What Is All the Talk about Textures? |
|
|
179 | (12) |
|
5.9 Onward to the Matrix: The Transformation Functions |
|
|
191 | (3) |
|
5.10 Animations with Texture Clipping |
|
|
194 | (4) |
|
5.11 The Final Frontier: Scrolling and Parallax Scrolling |
|
|
198 | (8) |
|
5.12 Going Out with a Bang: An OpenGL ES Shooter |
|
|
206 | (28) |
|
5.12.1 Complete Framework |
|
|
207 | (7) |
|
|
214 | (3) |
|
|
217 | (5) |
|
|
222 | (12) |
|
5.13 Support for Retina Displays under OpenGL ES |
|
|
234 | (3) |
|
5.13.1 Accurate Pixel Rendering |
|
|
234 | (1) |
|
5.13.2 Should I Utilize Full Resolution? |
|
|
234 | (1) |
|
5.13.3 Info: Pay Attention to Performance |
|
|
235 | (2) |
6 The Third Dimension 3D Games |
|
237 | (62) |
|
6.1 How Are 3D Games Constructed? |
|
|
237 | (2) |
|
|
239 | (1) |
|
6.3 The 3D Coordinate System |
|
|
240 | (1) |
|
6.4 Drawing Simple Shapes |
|
|
241 | (3) |
|
|
244 | (2) |
|
|
246 | (4) |
|
|
250 | (4) |
|
6.8 Creating, Loading, and Integrating 3D Models |
|
|
254 | (8) |
|
|
254 | (1) |
|
6.8.2 Construction of an Obj File |
|
|
255 | (7) |
|
6.9 Additional 3D Models with Texture |
|
|
262 | (4) |
|
6.10 First-Person Perspective: Setting and Deploying the Camera |
|
|
266 | (4) |
|
6.11 Spaceflight: A 3D Game Is Born |
|
|
270 | (29) |
|
6.11.1 Game Concept: Spaceflight |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
271 | (8) |
|
6.11.4 Three-Dimensional Sprites |
|
|
279 | (6) |
|
6.11.5 The Implementation of the Game Elements |
|
|
285 | (7) |
|
|
292 | (1) |
|
6.11.7 First-Person Perspective |
|
|
293 | (1) |
|
|
294 | (1) |
|
6.11.9 Notification of a Strike |
|
|
294 | (1) |
|
|
294 | (5) |
7 On the Trail of Angry Birds-Physics Engine Box2D |
|
299 | (30) |
|
|
299 | (2) |
|
7.1.1 What Should I Expect from a Physics Engine for 2D Games? |
|
|
300 | (1) |
|
|
301 | (1) |
|
7.2 How Do I Integrate Box2D? |
|
|
301 | (2) |
|
7.3 What Goes Up Must Come Down |
|
|
303 | (6) |
|
|
306 | (3) |
|
|
309 | (5) |
|
7.4.1 Possible Extensions |
|
|
313 | (1) |
|
7.5 A Box2D Game: Free the Birds |
|
|
314 | (15) |
|
7.5.1 Landscape versus Portrait Mode |
|
|
315 | (2) |
|
7.5.2 The New Sprite Classes |
|
|
317 | (2) |
|
|
319 | (6) |
|
|
325 | (1) |
|
|
326 | (3) |
8 The GLKit Framework-OpenGL ES Made Easy |
|
329 | (14) |
|
|
329 | (2) |
|
|
329 | (1) |
|
|
330 | (1) |
|
|
331 | (4) |
|
8.2.1 Setting the Perspective with the GLKit |
|
|
334 | (1) |
|
8.3 GLKitView and Game Loop |
|
|
335 | (5) |
|
8.4 GLKit and 3D-Using a Camera according to the GLU Model |
|
|
340 | (3) |
9 Complete Control: Game Sounds with OpenAL |
|
343 | (12) |
|
|
343 | (1) |
|
9.2 Encapsulation of the OpenAL API |
|
|
344 | (1) |
|
|
345 | (2) |
|
9.4 Creating a Polyphonic Sound Engine |
|
|
347 | (8) |
|
9.4.1 Sound IDs and Buffers |
|
|
348 | (1) |
|
|
349 | (1) |
|
|
350 | (1) |
|
9.4.4 Digression: Synthetic Sounds |
|
|
351 | (1) |
|
|
352 | (3) |
10 Waiting to Be a Millionaire |
|
355 | (4) |
|
10.1 Your Gateway to the World-iTunes Connect |
|
|
355 | (1) |
|
10.2 Test, Test, Test: But How Does a Game Get into My Device? |
|
|
356 | (1) |
|
10.3 Release and Distribution |
|
|
356 | (1) |
|
|
357 | (2) |
Bibliography |
|
359 | (2) |
Index |
|
361 | |