Search code examples
javajava-me3d2d

How do I develop Java games for phones?


How do I begin developing J2ME games for mobile phones?

  1. Are any libraries available that can render pixel fonts for text? - for text games
  2. Are 2D graphic libraries available that can draw animated bitmaps? - for isometric and tiled games
  3. Any are 3D engines available with texture mapping & lighting? -- for racing and flying simulators

And regarding screen sizes:

  • What screen size to choose initially for good market penetration?
  • How to manage game source code, in different screen sizes? Make separate branches?

I'm new to J2ME programming, so any links you can give me to start off would be great.


Solution

  • Screen size of 240x320 pixels is where most j2me-enabled phones are these days.

    Obviously, touchscreen phones usually have bigger screens than this. A VGA size of 480x640 is just around the corner for high-end phones.

    Different screen sizes are usually handled by having generic code that can handle any screen size and can modify layout depending on in-Jar configuration files. You then simply make several jar files, all containing the same compiled code but different values in the configuration files.

    For 3D graphics, a lot of phones these days support http://www.jcp.org/en/jsr/detail?id=184.

    Recent Sony-Ericsson phones also have http://www.jcp.org/en/jsr/detail?id=239 which should be easier to use if you already know OpenGL. 3D performances vary widly between phones that contain a hardware accelerator chip and those that don't.

    Animated bitmaps on J2ME usually means making you're own redrawing thread to refresh the screen. The only image format officially supported by the MIDP specification is PNG.

    Because of this last fact, if you want to create your own pixel font, you are pretty much going to need to have each character in a PNG image.

    You might want to look at LWUIT, an open source library published by Sun.