Bug Catch!

Tonight feels like the first night of actual coding. Although I’ve had the idea firmed up, picked a name, and had some very basic skeleton code for the project in mercurial for a few days, I finally feel like I’m starting to understand the basic structure of the game and how it’s all going to come together. I’ve been relying heavily on the SDK sample for lunar lander to get me pointed in the right direction. That seems to be one of the most common references in answers to “how to I write Android games?” questions.

The prevailing wisdom suggests keeping all of the rendering code for the game in its own thread separate from the rest of the game logic. Lunar Lander doesn’t go quite that far. It combines the rendering, game logic, and physics all in one thread, but separates that out from the main Activity. Following the same sort of organization I’ve been able to do some simple tests to get a background drawing, and to handle input events. Touch events (specifically ACTION_MOVE) don’t appear to be registering on the emulator. I’ll have to test it on a real device tomorrow to know whether it’s my code or just emulator madness. Additionally I was able to shim in a simple timer and a frame counter and rate target. Currently all my metrics are dumping to the log, so it would be nice to get those displaying to the screen along with a simple HUD for the game.

I’m at the point where I need to start breaking everything out into logical systems and organizing the code a bit better. More of a true game engine than the slop fest I’ve got going on right now. Now that I understand the basics it’s time to dig into the source of Replica Island a little more. It’s far more complex than anything I’ll need for Bug Catch, but it seems like a good code base to read to help me form a better picture of how all of the systems in a game need to be organized.