Contents at a Glance |
|
iv | |
Foreword |
|
ix | |
About the Author |
|
x | |
About the Technical Reviewers |
|
xi | |
About the Game Graphics Designer |
|
xii | |
Acknowledgments |
|
xiii | |
Preface |
|
xiv | |
|
Part I Planning and Creating 2D Games |
|
|
1 | (252) |
|
Chapter 1 Welcome to Android Gaming |
|
|
3 | (12) |
|
Programming Android Games |
|
|
4 | (1) |
|
Starting with a Good Story |
|
|
5 | (5) |
|
|
6 | (1) |
|
|
7 | (3) |
|
|
10 | (1) |
|
Gathering Your Android Development Tools |
|
|
10 | (4) |
|
|
12 | (2) |
|
Choosing an Android Version |
|
|
14 | (1) |
|
|
14 | (1) |
|
Chapter 2 Star Fighter: A 2-D Shooter |
|
|
15 | (12) |
|
Telling the Star Fighter Story |
|
|
15 | (3) |
|
|
18 | (6) |
|
Understanding the Game Engine |
|
|
18 | (2) |
|
Understanding Game-Specific Code |
|
|
20 | (3) |
|
Exploring the Star Fighter Engine |
|
|
23 | (1) |
|
Creating the Star Fighter Project |
|
|
24 | (2) |
|
|
26 | (1) |
|
Chapter 3 Press Start: Making a Menu |
|
|
27 | (46) |
|
Building the Splash Screen |
|
|
27 | (21) |
|
|
28 | (7) |
|
Creating Your Splash Screen Image |
|
|
35 | (2) |
|
Working with the R.java File |
|
|
37 | (1) |
|
|
38 | (7) |
|
|
45 | (3) |
|
|
48 | (13) |
|
|
54 | (1) |
|
|
54 | (2) |
|
|
56 | (2) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (11) |
|
|
64 | (5) |
|
|
69 | (3) |
|
|
72 | (1) |
|
Chapter 4 Drawing The Environment |
|
|
73 | (46) |
|
|
74 | (30) |
|
Creating the Creating the Creating the |
|
|
75 | (4) |
|
|
79 | (6) |
|
Loading an Image Using OpenGL |
|
|
85 | (12) |
|
|
97 | (7) |
|
|
104 | (9) |
|
|
106 | (1) |
|
|
107 | (2) |
|
Working with the Matrices |
|
|
109 | (2) |
|
Finishing the scrollBackground2() Method |
|
|
111 | (2) |
|
Running at 60 Frames per Second |
|
|
113 | (4) |
|
|
114 | (2) |
|
Clearing the OpenGL Buffers |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (1) |
|
Chapter 5 Creating Your Character |
|
|
119 | (40) |
|
|
119 | (3) |
|
|
122 | (10) |
|
Creating Texture Mapping Arrays |
|
|
123 | (4) |
|
Loading a Texture onto Your Character |
|
|
127 | (4) |
|
|
131 | (1) |
|
|
132 | (19) |
|
Drawing the Default State of the Character |
|
|
133 | (3) |
|
Coding the PLAYER_RELEASE Action |
|
|
136 | (2) |
|
Moving the Character to the Left |
|
|
138 | (2) |
|
Loading the Correct Sprite |
|
|
140 | (3) |
|
Loading the Second Frame of Animation |
|
|
143 | (3) |
|
Moving the Character to the Right |
|
|
146 | (2) |
|
Loading the Right-Banking Animation |
|
|
148 | (3) |
|
Moving Your Character Using a Touch Event |
|
|
151 | (5) |
|
|
152 | (2) |
|
Trapping ACTION_UP and ACTION_DOWN |
|
|
154 | (2) |
|
|
156 | (1) |
|
|
157 | (2) |
|
Chapter 6 Adding the Enemies |
|
|
159 | (18) |
|
|
159 | (1) |
|
|
160 | (4) |
|
|
164 | (11) |
|
Adding a New Sprite Sheet |
|
|
165 | (1) |
|
Creating the SFEnemy Class |
|
|
166 | (4) |
|
|
170 | (5) |
|
|
175 | (2) |
|
Chapter 7 Adding Basic Enemy Artificial Intelligence |
|
|
177 | (30) |
|
Getting the Enemies Ready for Al |
|
|
177 | (7) |
|
Creating Each Enemy's Logic |
|
|
179 | (3) |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
184 | (3) |
|
Creating the moveEnemy() Method |
|
|
185 | (1) |
|
Creating an enemies[ ] Array Loop |
|
|
185 | (1) |
|
Moving Each Enemy Using Its Al Logic |
|
|
186 | (1) |
|
Creating the Interceptor Al |
|
|
187 | (11) |
|
|
188 | (1) |
|
Locking on to the Player's Position |
|
|
189 | (2) |
|
Implementing a Slope Formula |
|
|
191 | (7) |
|
|
198 | (5) |
|
Setting a Random Point to Move the Scout |
|
|
199 | (2) |
|
Moving Along a Bezier Curve |
|
|
201 | (2) |
|
|
203 | (2) |
|
|
205 | (2) |
|
Chapter 8 Defend Yourself! |
|
|
207 | (36) |
|
Creating a Weapon Sprite Sheet |
|
|
207 | (4) |
|
|
209 | (2) |
|
Giving Your Weapon a Trajectory |
|
|
211 | (8) |
|
|
211 | (1) |
|
Adding a Second Sprite Sheet |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
Detecting the Edge of the Screen |
|
|
215 | (3) |
|
Calling the firePlayerWeapons() Method |
|
|
218 | (1) |
|
Implementing Collision Detection |
|
|
219 | (5) |
|
Applying Collision Damage |
|
|
219 | (1) |
|
Creating the detectCollisions() Method |
|
|
220 | (1) |
|
Detecting the Specific Collisions |
|
|
221 | (1) |
|
|
222 | (2) |
|
Expanding on What You Learned |
|
|
224 | (1) |
|
|
224 | (1) |
|
Reviewing the Key 2-D Code |
|
|
225 | (18) |
|
Chapter 9 Publishing Your Game |
|
|
243 | (10) |
|
|
243 | (1) |
|
Preparing to Sign, Align, and Release |
|
|
244 | (8) |
|
Checking the Readiness of AndroidManifest |
|
|
247 | (2) |
|
|
249 | (3) |
|
|
252 | (1) |
|
|
253 | (48) |
|
Chapter 10 Blob Hunter: Creating 3-D Games |
|
|
255 | (16) |
|
Comparing 2-D and 3-D Games |
|
|
255 | (1) |
|
Creating Your 3-D Project |
|
|
256 | (3) |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
258 | (1) |
|
|
259 | (1) |
|
Creating a 3-D Object Test |
|
|
259 | (11) |
|
|
260 | (1) |
|
Creating the BHWalls Class |
|
|
261 | (2) |
|
Instantiating the BHWalls Class |
|
|
263 | (1) |
|
|
264 | (2) |
|
|
266 | (1) |
|
Creating the drawBackground() Method |
|
|
267 | (2) |
|
Adding the Finishing Touches |
|
|
269 | (1) |
|
|
270 | (1) |
|
Chapter 11 Creating an Immersive Environment |
|
|
271 | (16) |
|
|
271 | (2) |
|
Creating a Corridor from Multiple BHWalls Instances |
|
|
272 | (1) |
|
Using the BHCorridor Class |
|
|
273 | (11) |
|
Building the BHCorridor Class |
|
|
274 | (9) |
|
|
283 | (1) |
|
|
284 | (1) |
|
|
285 | (2) |
|
Chapter 12 Navigating the 3-D Environment |
|
|
287 | (14) |
|
Creating the Control Interface |
|
|
287 | (4) |
|
|
288 | (1) |
|
Editing BiobhunterActivity |
|
|
289 | (2) |
|
Moving Through the Corridor |
|
|
291 | (3) |
|
Adjusting the View of the Player |
|
|
293 | (1) |
|
|
294 | (1) |
|
Reviewing the Key 3-D Code |
|
|
295 | (6) |
Index |
|
301 | |