Here is my take on it.
The squares and circles are of even numbers.
Both sets are either a square class or a circle class.
Each circle corresponds with its own square simply using it’s z-index.
You do not have to code for the z-index just use the natural order that they have in the element panel.
when added to an array they will be that order. i.e front most circle element will be item 0 in the array and the same for a square.
(You can use any other way to tie them together.)
This example does what you want I think. I have a very small margin for distance. adjust as needed.
Having uneven classes will break this. Still trying to figure a way of doing that. i.e 3 squares and 2 circles but in most cases you will always want even numbers.
hitTestGroup2.hype.zip (23.1 KB)