How do I manage sprites in my J2ME games?
Are there any libraries for J2ME to manage bitmap sprites for games? 开发者_运维知识库
There's actually a game API in J2ME's MIDP 2.0 standard which has a bunch of game-centric classes, including a Sprite class. Check out this Tutorial for a good overview to using the J2ME Game API.
http://today.java.net/pub/a/today/2005/07/07/j2me3.html
Try using a TiledLayer, it gives you the option to manage and array of images in a more elegant way. Also it is less memory intensive. You just load one tiled image and the TiledLayer will do the job for you
There is not much to manage. You can load a png image with transparency info with Image.createImage("/sprite.png");
this image can be blitted anywhere on the screen.
You could create a simple sprite class, which has the image, an x and y position, and use this.
For simple collision detection you could just compare the bounding rectangles of 2 sprites.
R
精彩评论