| About the Author |
|
xv | |
| About the Technical Reviewer |
|
xvii | |
| Acknowledgments |
|
xix | |
| Introduction |
|
xxi | |
|
Part 1 Get Ready... Get Set... |
|
|
1 | (42) |
|
Chapter 1 Say Hello to My Little Friend: The Corona SDK |
|
|
3 | (16) |
|
A Long Time Ago In a School (Perhaps) Far, Far Away... |
|
|
3 | (2) |
|
|
|
5 | (1) |
|
Hey, Wait, Isn't This Book about the Corona SDK?! |
|
|
5 | (1) |
|
Corona: History at a Glance |
|
|
6 | (2) |
|
A Tool That Works for You |
|
|
8 | (5) |
|
|
|
13 | (5) |
|
|
|
18 | (1) |
|
Chapter 2 The Pillar of Creation: Lua |
|
|
19 | (24) |
|
|
|
19 | (1) |
|
The Bare Necessities: Lexicology |
|
|
20 | (2) |
|
The Keys to Success: Keywords |
|
|
22 | (2) |
|
Making a Statement: Commenting |
|
|
24 | (1) |
|
A Place for Your Stuff: Variables, Values, and Types |
|
|
25 | (3) |
|
Expressing Yourself: Expressions and Operators |
|
|
28 | (2) |
|
Let's Table This Discussion: The Mythical "Table" |
|
|
30 | (3) |
|
Getting Functional: All about Functions |
|
|
33 | (5) |
|
Taking Control: Control Structures |
|
|
38 | (1) |
|
Knocked for a Loop: The for, while, and repeat Constructs |
|
|
39 | (1) |
|
Compartmentalizing: Modules |
|
|
40 | (1) |
|
Variations on a Theme: Changes Made to Lua in Corona |
|
|
41 | (1) |
|
|
|
42 | (1) |
|
|
|
43 | (160) |
|
Chapter 3 Basic Application Structure |
|
|
45 | (26) |
|
The-Year Is 2258 ... The Name of the Place... err, Game... |
|
|
45 | (1) |
|
Mapping out the Astro Rescue Game |
|
|
46 | (1) |
|
You're Sceneing Things: The Storyboard API |
|
|
47 | (2) |
|
Every Event Needs a Handler |
|
|
49 | (1) |
|
The Life (and Death) of a Scene |
|
|
50 | (1) |
|
Making the Transition: Transition Effects |
|
|
51 | (1) |
|
Scene Purging for Fun and Profit |
|
|
51 | (2) |
|
Back to the Beginning: The main.lua file |
|
|
53 | (1) |
|
|
|
53 | (1) |
|
|
|
54 | (2) |
|
Dealing with Game State: File I/O Operations |
|
|
56 | (3) |
|
Where It All Begins: Initial Execution |
|
|
59 | (2) |
|
|
|
61 | (1) |
|
Talking to Yourself: Log Messages |
|
|
62 | (1) |
|
Audio Mish-Mosh: Handling Cross-Platform Audio Concerns |
|
|
63 | (1) |
|
Then, the Closer Comes in to Finish the Ninth Inning |
|
|
63 | (1) |
|
Even Further Back: build.settings and config.lua |
|
|
64 | (1) |
|
|
|
64 | (3) |
|
|
|
67 | (3) |
|
|
|
70 | (1) |
|
Chapter 4 Title, Menu, and Settings Scenes |
|
|
71 | (32) |
|
Welcome, Ladies and Gents: The Title Scene |
|
|
71 | (2) |
|
|
|
73 | (4) |
|
|
|
77 | (2) |
|
|
|
79 | (1) |
|
|
|
80 | (1) |
|
Some Unused Scene Event Handlers |
|
|
80 | (1) |
|
|
|
81 | (1) |
|
|
|
82 | (1) |
|
Wrapping up the Title Scene |
|
|
82 | (1) |
|
What'll You Have? The Menu Scene |
|
|
83 | (1) |
|
|
|
84 | (4) |
|
Some Unused Scene Event Handlers |
|
|
88 | (1) |
|
Oh, Those Beautiful Shapes! |
|
|
88 | (2) |
|
Creating Graphics from Scratch |
|
|
90 | (4) |
|
Wrapping up the Menu Scene |
|
|
94 | (1) |
|
The Choice Is Yours: The Settings Scene |
|
|
94 | (2) |
|
|
|
96 | (4) |
|
Some Unused Scene Event Handlers |
|
|
100 | (1) |
|
Wrapping up the Settings Scene |
|
|
100 | (1) |
|
|
|
101 | (2) |
|
Chapter 5 The Game, Part 1: Core Game Code |
|
|
103 | (46) |
|
The Game Scene Kicks It All Off |
|
|
103 | (1) |
|
The World of the Real: Physics |
|
|
104 | (5) |
|
The Scene Lifecycle Handlers |
|
|
109 | (1) |
|
Getting to the Heart of the Matter: The gameCore Object |
|
|
110 | (2) |
|
Stuff Is Better When It Moves: Sprites, Part 1 |
|
|
112 | (4) |
|
|
|
116 | (6) |
|
Where It All Starts: Initializing the Game |
|
|
122 | (2) |
|
Loading Graphic Resources |
|
|
124 | (1) |
|
Stuff Is Still Better When It Moves: Sprites, Part 2 |
|
|
125 | (3) |
|
Moving Right Along, Redux |
|
|
128 | (5) |
|
Got to Begin Again: Resetting for a New Level |
|
|
133 | (4) |
|
Kick It Off: Starting the Game |
|
|
137 | (1) |
|
Okay, That'll Do: Stopping the Game |
|
|
138 | (1) |
|
Destruction: Cleaning Up After Ourselves |
|
|
139 | (2) |
|
We Need a Playfield: Drawing the Current Level |
|
|
141 | (4) |
|
Communication Is Key: Showing a Quick Message |
|
|
145 | (1) |
|
Cut It Out Right Now, You Kids: Stopping Game Activity |
|
|
146 | (2) |
|
|
|
148 | (1) |
|
Chapter 6 The Game, Part 2: Main Loop |
|
|
149 | (18) |
|
|
|
149 | (3) |
|
|
|
152 | (3) |
|
|
|
155 | (3) |
|
|
|
158 | (1) |
|
|
|
159 | (1) |
|
|
|
160 | (1) |
|
|
|
160 | (2) |
|
|
|
162 | (1) |
|
|
|
163 | (2) |
|
|
|
165 | (1) |
|
|
|
166 | (1) |
|
Chapter 7 The Game, Part 3: Player Control Input |
|
|
167 | (10) |
|
|
|
167 | (1) |
|
|
|
168 | (1) |
|
|
|
168 | (1) |
|
|
|
169 | (1) |
|
|
|
169 | (1) |
|
When All Is Said and Done |
|
|
169 | (1) |
|
Handling Accelerometer Input |
|
|
170 | (1) |
|
|
|
170 | (2) |
|
|
|
172 | (1) |
|
|
|
172 | (1) |
|
Again, Out of the Bullpen to Close It out |
|
|
173 | (1) |
|
Updating Audio and Animations |
|
|
173 | (2) |
|
More on Input Handling with Corona |
|
|
175 | (1) |
|
|
|
176 | (1) |
|
Chapter 8 The Game, Part 4: Collision Events |
|
|
177 | (14) |
|
|
|
177 | (1) |
|
Bounding Boxes Collisions |
|
|
178 | (1) |
|
|
|
179 | (1) |
|
|
|
180 | (2) |
|
|
|
182 | (1) |
|
These Are Bad, M'Kay? Crashing into Stuff |
|
|
182 | (1) |
|
Set'er Down Gently: Landing on a Pad |
|
|
183 | (1) |
|
You're All Clear, Kid, Now Let's Blow This Thing and Go Home! Entering the Landing Bay |
|
|
184 | (1) |
|
Err, Sorry, Sir: Hitting a Colonist |
|
|
185 | (1) |
|
Getting Gas Isn't Always a Social Faux Pas: Fuel Pods |
|
|
185 | (1) |
|
|
|
186 | (3) |
|
|
|
189 | (1) |
|
|
|
190 | (1) |
|
|
|
191 | (12) |
|
|
|
191 | (3) |
|
|
|
194 | (3) |
|
|
|
197 | (1) |
|
Get That Spotlight Moving! |
|
|
198 | (1) |
|
|
|
199 | (1) |
|
|
|
200 | (1) |
|
|
|
201 | (1) |
|
|
|
201 | (2) |
|
|
|
203 | (54) |
|
|
|
205 | (26) |
|
Files Are So Passe: SQLite Database |
|
|
205 | (1) |
|
What's This SQLite You Speak of? |
|
|
206 | (1) |
|
Let's Create a Database Already! |
|
|
207 | (2) |
|
|
|
209 | (1) |
|
Data Amnesia: In-Memory Databases |
|
|
210 | (1) |
|
Talkin' to the Outside World: Network Access |
|
|
210 | (1) |
|
Some Basic Network Functionality |
|
|
210 | (4) |
|
There's More to Networking than Getting Content |
|
|
214 | (1) |
|
I'm Always Losing My Gym Sockets: Socket Networking |
|
|
215 | (2) |
|
|
|
217 | (2) |
|
|
|
219 | (1) |
|
|
|
220 | (3) |
|
|
|
223 | (1) |
|
|
|
223 | (2) |
|
|
|
225 | (2) |
|
|
|
227 | (1) |
|
|
|
228 | (2) |
|
|
|
230 | (1) |
|
Chapter 11 Testing and Publishing |
|
|
231 | (26) |
|
Feed the Robot: Building for Android |
|
|
231 | (6) |
|
Deploying to Android Devices |
|
|
237 | (1) |
|
On-Device Debugging with Android |
|
|
238 | (5) |
|
An Apple a Day: Build for iOS |
|
|
243 | (3) |
|
Creating an iOS App Store Package |
|
|
246 | (1) |
|
|
|
247 | (1) |
|
On-Device Debugging with iOS |
|
|
247 | (1) |
|
The App Store Model of Distribution |
|
|
248 | (1) |
|
|
|
249 | (2) |
|
Other App Stores: Amazon Appstore for Android and Barnes & Noble Nook Store |
|
|
251 | (1) |
|
The Only Game in Town for iOS: The Apple App Store |
|
|
252 | (1) |
|
Publishing to the Apple App Store |
|
|
252 | (4) |
|
|
|
256 | (1) |
| Index |
|
257 | |