We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have an array of narrow vertical rectangles. Each rectangle moves randomly back and forth (left to right) across the screen.
When *any of these overlap I want an event to happen, eg. println "overlapping". So far this works fine with 2 rectangles, but only by referring directly to their number and not array indices.
When I try indexing, I am running into the issue that, when a rectangle is checking if it overlaps another, it is also checking if it overlaps itself, and thus always returns "overlapping". I get what is happening but how to solve it is a little beyond my reasoning abilities.
Would anyone care to offer some tips? Many thanks.