×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    8

    Question Collision detection question

    Hi,

    In my midp 2.0 application i am writing large amounts of code to detect collions between lots of images. Is there a way that i can check for a collision from anything with a certain object, instead of having to specify every object it could possibly collide with?

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249
    I'm no expert at j2me, but here's a suggestion that at this moment seems to make sense to me.

    Try keeping a hashtable (well, create your own since j2me doesn't have it i believe) and map the objects according to x or y-coordinates.

    Although you'll have to update the table each time anything moves, you can easily cut your search down by only checking for collisions between only the relevant x coordinates for example.

    If you come up with a reason why it might be less efficient than what you're currently implementing, I'd like to know.

    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×