MIDP2 Sprite Collision Bug?

I wonder if there is a bug with the collision detection in the MIDP2 Sprite implementation in the J2ME Wireless Toolkit?

I've been trying to write a simple game to get myself up to speed with the new game classes in the current J2ME implementation. I won't bore you with the details, suffice to say that I have a sprite I'm moving about and checking for pixelLevel collisions on a tiled background.

This seems to work fine until I change direction. When this happens I apply a transform to the sprite either using TRANS_MIRROR or TRANS_NONE, so the sprite faces the direction of travel. When this happens, the collision detection seems to detect a collision if any part of the background tile has content in, not just if I have a real collision.

The solution to this problem seems to be to move the collision detection to before any Sprite transformation.

It's now time to refactor my code to account for this.

Entered: 2005-02-03 22:33:33

Rob's Other Blog Entries

See other blog entries for February 2005, or an index of all blog entries.