Per pixel, point, bounding box

This forum is currently in read-only mode.
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • A few questions. I having some issues with collision detection, using the bullet/ turret behavior.

    I'm guessing point means detection is by the image point, per pixel is by each visible pixel within a sprite, and bounding box is by the entire image, including any alpha channel.

    First question, are they compatible? In other words can one object using bounding box, be used with another using point?

    Second question, if you use point, will multiple points on one object register?

    Third, why are some of my collisions, not being detected?

  • First question, are they compatible? In other words can one object using bounding box, be used with another using point?

    Yes. Bounding box and per pixel, for example, treats the bounding box as a big square opaque sprite when testing collisions with per pixel sprites. Try experimenting with some sprites and settings.

    [quote:2jk5xq9i]Second question, if you use point, will multiple points on one object register?

    Point means the hot spot only. This can be useful if you're using really small sprites and don't need per pixel collisions. Point against bounding box checks if the hot spot is inside the bounding box, and point against per pixel checks if the hot spot is overlapping a non-transparent pixel. Image points are ignored.

    [quote:2jk5xq9i]Third, why are some of my collisions, not being detected?

    I have no idea. Post a .cap or some more information and maybe someone will have a chance of being able to answer this!

  • Ok thanks

    cap loaded here http://www.scirra.com/phpBB3/viewtopic.php?f=16&t=2232

    Now Im wondering if this might have something to do with the sprites sometimes overlapping as well.

    I've found that bounding box works best for the rts movement, as you can give each sprite a little extra space by making the border larger than the actual image.. i.e. alpha channel larger than the sprite.

    Unfortunately, that gives a problem when the bullets hit the bounding box, and seemingly disappear in midair.

  • that gives a problem when the bullets hit the bounding box, and seemingly disappear in midair.

    You could use separate sprites for the visible object and the collision-detecting bounding box - and test for bullet collisions with the visible object.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Or just say "that's the invisible force field".

    Thanks will give your way a try.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)