Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


[java] Pixel Level Collision in J2ME????

This topic is 5401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi hope every one is fine. i want to know that how can we do pixel level collion in J2ME, i know that there are methods for this in MIDP2 but how can i do it in MIDP1.0. bye

Share this post

Link to post
Share on other sites
There is no "straight" way to do it in standard MIDP 1.0, since you can''t access pixel data in the images. And even if there was it would be sloooooooooow.
You can work around this by supplying collision masks for your sprites, ie, and array of ints with 0 for transparent pixels and 1 for non-transparent ones. To save some space (we all know how much space matters in J2ME) you could bitpack the data since you only need zeroes and ones, and you could also make the collision maps of a lower resolution than the actual sprite (ie, every bit in the collision mask represents a n*n square of pixels instead of just one).

This won''t be fast either, so you should ask yourself if you really need pixel-level collision.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!