Wombat roadkill, or fun with J2ME.

It occurred to me a while back that programming games would be far more interesting than doing business applications all the time – anyone who codes for a living could probably agree that you need to flex the brain muscles every now and again…

So I did some thinking and came to the conclusion that J2ME would be a good platform to get into – it’s still an area where a guy working by himself or with some mates could still do up a fairly decent game in a relatively short amount of time (sub 6 months). No proprietary APIs to buy into, the tools are freely available and the target device is in everyone’s pocket already.

I hightailed off to Sun, went through their reference materials, the CLDC and MIDP docs, downloaded the sample game and went – “Sweet, I can do this.”

The good folks at Netbeans.org have developed a Mobility Pack that you install on top of Netbeans 4.x that comes with pretty much everything you need to get started – debugging, the J2ME runtime and the various baseline Sun simulators. The debugger plugs into the standard mobile simulator architecture (UEI), so you can test the code on sims provided by the various mobile vendors. As well as this it has some excellent utilities to manage issues such as device fragmentation (differing capabilities and resources between phone models).

Most of the mobile vendors have sites with development resources such as proprietary APIs, simulators, code samples and forums. I’ll be adding links to some of these at a later stage, as I get around to using them – it seems there’s no standard for making a phone vibrate 🙂

To meet my ends I’m currently going through a really good book on the subject, J2ME Games Programming. Having finally beaten through the first couple of chapters that introduce the basic APIs (it always seems to be a hard slog for the first part of any such book), I’m finally on to coding the first sample game, Road Run – a Frogger-inspired game with a wombat. Pretty cool stuff – and a great intro to the problems ahead. What’s the story with hardcoding the sizes of game elements? My first run-in with differing devices – I’m running it against a different sized simulator screen, and it’s all messed up. I love trying to get other people’s code working 😛 Hopefully tomorrow, the wombat will cross the road without getting run over by cars that appear from nowhere…


Posted

in

by

Tags: