In your last post, that should set each sprite that is less then 50px away from each other opaque.
That works if the sprites in the layout are far away from each other, creating the illusion that those that are close to the one that is locked to the mouse are picked.
That works if that was what you intended to do.
Yeah... Last test does what I intended it to do. but is a bit heavy on resources (for each) as it goes through every single family1 object every tick and checks if there is any object in family 2 within the specified distance. If I have a lot of objects that's gonna be super heavy, so it's not optimal.
Now I'm looking for a smarter (more performance friendly) way to do the same thing with events. I know i could use collisions to do something similar, but I'm trying to do sort of a customized collision detection based on distance between objects or within a radius in a family, and not a collision polygon.
Maybe the most efficient way would be to add some steps or increment? First i can start by checking every 0.5 seconds if somethinng is within a slightly larger radius. I could create a variable (check rate) that is based on the distance between objects, that gets smaller as the distance shrinks.