A Programmer's Progress
A programmer's progress can often be represented thusly:
foreach(step_forward) { |
For the last couple months, I've been working on prototyping an Android game. I've been interested in exploring indirect control schemes for games (kinda-sorta like Lemmings, if you've played that). It seems especially fitting for mobile interfaces... it annoys me when touch-screen games require precise control that's difficult to achieve on such a small device. I started with Java, then was turned toward Processing (which is really just a layer atop Java) by a friend and accomplished Android developer, Matt Parker.
After a few weeks, I had the movement down I wanted, but as I fleshed out certain routines such as collision detection and physics simulations, I felt like I was reinventing the wheel. I knew other people had done this before, and had done it better than I could. That's when I discovered Box2D, a open source C++ physics engine, and its Java port JBox2D. Several physics-oriented games (including Angry Birds) use this library, so it seemed like the right direction to go, but it would require reworking pretty much everything. Still, that would take less time than recreating all these functions myself. So, cortex to the grindstone, I continued.
After working with the engine a bit, I really came to like it. Even the vector object (Vec2) and methods worked better than Processing's default PVector. But I'm no physics genius, and the library isn't exactly straightforward. Thankfully, there are some excellent tutorials out there, and some clever folks have even written wrappers to make it easier to use with Processing. One of these was BoxWrap2D. This would require yet more rework, but I was knee deep by now so onward I slogged. A week later, I had things working to a point and began testing on my Droid X. Nothing would move on the screen. After some research, it became clear that BoxWrap2D just doesn't render on Android yet (which is understandable; the author considers it a "pre-alpha" version).
This was a most frustrating setback. I was sick of reworking the same things over and over again. I got over this quickly when I discovered Fisica: another, more elegant JBox2D wrapper. There are a few things I don't like about it--like most coordinate methods take float x, float y parameters, while I'd find Vec2 preferable, and the underlying JBox2D objects are protected--but those things aside, it's decently straightforward and runs on Android. Now I'm hung up on some hopefully minor points (sensor collisions, dynamic body scaling), and think I'll have an updated prototype in a week or so. Next post, more talk about gameplay and less about all these under-the-hood details.

Add new comment