Introduction | p. XXIX |
| p. 1 |
Getting Started | p. 3 |
So You Want to Be a Game Programmer | p. 4 |
Who Is This Book For? | p. 4 |
How to Choose Your Device | p. 5 |
The Long Haul | p. 6 |
What You'll Need | p. 7 |
Choosing a Compiler | p. 7 |
Other Software | p. 8 |
Understanding Game Development | p. 9 |
The Development Cycle | p. 9 |
Go Team! (or Go Solo) | p. 16 |
The Hardware | p. 19 |
The PDA | p. 20 |
A Brief History | p. 20 |
Thinking Like a User | p. 23 |
The Future of PDAs | p. 25 |
The Palm Philosophy | p. 25 |
"Sophisticated Simplicity" | p. 26 |
Looking to the Future | p. 28 |
The Desktop Companion | p. 28 |
Palm Input | p. 29 |
The Touch Screen | p. 29 |
Graffiti | p. 34 |
Hard Keys | p. 35 |
Alternative Input Methods | p. 36 |
Designing Input | p. 37 |
Simple Is Better | p. 37 |
Under the Hood | p. 38 |
Shortcomings | p. 41 |
Not a Desktop Machine | p. 41 |
Storage and Code Design | p. 42 |
Smaller Is Better, Isn't It? | p. 43 |
Summary | p. 44 |
Writing Your First Program | p. 45 |
Hello World | p. 46 |
Not Really C | p. 46 |
The Code | p. 47 |
Taking a Closer Look | p. 49 |
The Palm Event Loop | p. 51 |
Understanding Events | p. 51 |
Using the Event Manager | p. 52 |
Compiling Your Program | p. 53 |
GCC | p. 53 |
CodeWarrior | p. 56 |
Debugging Code | p. 59 |
The Palm OS Error API | p. 59 |
Debugging with POSE | p. 61 |
Summary | p. 67 |
Examples | p. 67 |
| p. 69 |
The Bare Essentials | p. 71 |
Setting Up | p. 72 |
Full Screen or Windowed? | p. 72 |
Working with Resources | p. 73 |
Introducing the Bitmap | p. 74 |
The Resource Compiler | p. 75 |
Drawing Your Bitmap | p. 86 |
Creating Windows | p. 86 |
A Simple Way to Draw | p. 89 |
Double Buffering | p. 90 |
What Is Double Buffering? | p. 91 |
Creating a Secondary Buffer | p. 94 |
Flipping | p. 94 |
The Canvas Class | p. 95 |
The Basic Design | p. 95 |
Working with a Canvas | p. 98 |
Getting Things Going with the SystemManager | p. 99 |
Polling the OS | p. 99 |
Using the SystemManager | p. 103 |
Working with Color | p. 105 |
Summary | p. 107 |
Examples | p. 107 |
Reading and Writing Files | p. 109 |
A Break from Tradition | p. 110 |
Palm Databases | p. 110 |
The Data Manager | p. 113 |
Creating a New Database | p. 113 |
Opening a Database | p. 114 |
Records | p. 115 |
Data Manager Error Codes | p. 120 |
File Streaming | p. 122 |
Opening a Stream | p. 123 |
Reading from a Stream | p. 125 |
Writing to a Stream | p. 126 |
Cleaning Up | p. 127 |
Controlling Streams | p. 127 |
Error Codes | p. 130 |
Summary | p. 131 |
Bring on the Sprites | p. 133 |
What Is a Sprite? | p. 134 |
Bringing Your Games to Life | p. 134 |
A Typical Sprite | p. 135 |
Working with Animation | p. 138 |
How Animation Works | p. 138 |
A Simple Example | p. 139 |
Timing | p. 141 |
Controlling Animation | p. 142 |
Transparency | p. 145 |
What Is a Mask? | p. 146 |
Making Sprites Transparent | p. 148 |
Using Transparency Wisely | p. 148 |
A Palm-Sized Sprite Library | p. 149 |
Working with Animation | p. 149 |
Sprites | p. 155 |
Summary | p. 157 |
Examples | p. 157 |
Input | p. 159 |
Input and the OS | p. 160 |
Input Management | p. 160 |
Breaking the Mold | p. 162 |
EventType Structure | p. 163 |
The Touch Screen | p. 164 |
Using Graffiti | p. 164 |
Tracking the Stylus | p. 168 |
The Buttons | p. 170 |
The Hard Key Dilemma | p. 170 |
Handling Hard Keys | p. 171 |
The Future | p. 172 |
The Input Class | p. 172 |
Designing a Reusable Input System | p. 172 |
Implementation | p. 178 |
Summary | p. 185 |
Working with Tiles | p. 187 |
Understanding Tiles | p. 188 |
What Is a Tile Exactly? | p. 188 |
Layers | p. 190 |
Collision Detection | p. 191 |
Implementing a Tile Engine | p. 193 |
Tile Sets | p. 193 |
Map Format | p. 194 |
Tile Engine Classes | p. 195 |
Efficiency | p. 205 |
Summary | p. 206 |
Example | p. 206 |
Physics: The Science of Your World | p. 207 |
Why Is Physics Important? | p. 208 |
A World without Physics | p. 208 |
What Is Physics? | p. 209 |
Basic Collision Detection | p. 210 |
Bounding Boxes | p. 210 |
Detecting Collisions | p. 212 |
Implementing a Collision Scheme | p. 214 |
Kinematics Equations: The Mathematics of Motion | p. 216 |
Linear Motion | p. 217 |
Putting Kinematics to Work | p. 223 |
Influencing Motion by Force | p. 224 |
May the Force | p. 225 |
Newton's Laws | p. 225 |
Forces, Practically Speaking | p. 228 |
Responding to Collisions | p. 230 |
Implementing a Physics System | p. 231 |
Design | p. 232 |
Implementation | p. 232 |
Summary | p. 241 |
Example | p. 242 |
Bringing It All Together: Building a Reusable Game Engine | p. 243 |
The Framework | p. 244 |
What's a Framework? | p. 244 |
The PGL_Presentation Class | p. 246 |
Input and the Framework | p. 248 |
PGL-man: A Game Example | p. 248 |
The User Interface | p. 249 |
Basic Game Architecture | p. 256 |
The Welcome Screen | p. 258 |
The High Scores Screen | p. 259 |
Gameplay | p. 261 |
The Game Code | p. 267 |
Summary | p. 278 |
Examples | p. 279 |
| p. 281 |
Multiplayer Games | p. 283 |
Designing for Multiplayer | p. 284 |
Design Early, Design Often | p. 285 |
Interaction | p. 285 |
Different Devices, Different Experiences | p. 286 |
Cheating | p. 286 |
Multiplayer Option or a True Multiplayer Game? | p. 287 |
Communicating via Sockets | p. 287 |
Communication Methods | p. 288 |
Net Support | p. 290 |
Establishing a Connection | p. 291 |
Sending and Receiving Data | p. 298 |
Closing a Socket | p. 300 |
Internet Game Programming | p. 301 |
Implementing a Multiplayer Game | p. 302 |
A Typical Multiplayer Game | p. 304 |
Summary | p. 307 |
Artificial Intelligence | p. 309 |
What Is Artificial Intelligence? | p. 310 |
SI Techniques | p. 312 |
Finite State Machines | p. 312 |
Environment-Based SI | p. 312 |
Genetic Programming | p. 314 |
Neural Networks | p. 316 |
Practical SI on the Palm OS | p. 316 |
Path Finding | p. 317 |
Decision Making | p. 322 |
Environmental SI | p. 326 |
Fuzzy Logic and Machine Reasoning | p. 328 |
A Brief Introduction to Set Theory | p. 329 |
Limitation of Traditional Sets | p. 330 |
Fuzzy Sets | p. 330 |
Fuzzy Set Theory | p. 333 |
Summary | p. 334 |
Examples | p. 335 |
Advanced Topics | p. 337 |
Multisegment Applications | p. 338 |
General Workarounds | p. 339 |
Segmenting CodeWarrior Applications | p. 340 |
Segmenting a PRC-Tools Application | p. 342 |
Localizing Your Application | p. 345 |
The String Table | p. 345 |
The Palm OS International API | p. 346 |
Client-Side Prediction | p. 349 |
Working with Client-Side Prediction | p. 349 |
Prediction Side-Effects | p. 350 |
The GCC New Allocator | p. 352 |
A First Solution | p. 352 |
A New Problem | p. 352 |
A Bitmap Cache | p. 354 |
A Brief Introduction to Bitmap Caching | p. 354 |
Implementing a Simple Cache | p. 355 |
Using the PGL_CanvasCacheManager | p. 356 |
Summary | p. 358 |
Publishing Your Palm Game | p. 361 |
Publishing Your Game on Your Own Web Site | p. 363 |
Using a Well-Known Web Site | p. 365 |
Using a Publisher | p. 366 |
Summary | p. 367 |
Sound | p. 369 |
Selected Palm API Reference | p. 377 |
Other Language Options | p. 391 |
Resources | p. 397 |
What's on the CD | p. 401 |
Index | p. 407 |
Table of Contents provided by Syndetics. All Rights Reserved. |