I have objects in an array list. They are rectangular, but more complex than single rectangles. They are collections of rectangles. I want something to happen if two of these “Animal” objects touch. If these were not in a list, this would be fairly easy, because they would have been initialized separately making interaction of one in terms of the other easy to describe. Since they are in an array (an array list actually… with its peculiar syntax) I am vexed on how to do this. I am looping through the “animals” arraylist with two different nested loops, but when trying to read arithmetic relations between the two objects, it does this for every object, including that object in relation with itself, so the boolean is alway true!
The following code is excessively complex, because it contains the class with all its stuff. I don’t think that what’s inside the class is important (other than the location vectors). What is important in regard to the present problem is what’s outside the class.
I will post the code on a reply to my own topic because I am exceeding the number of characters.
EDIT: I cannot post the class because the code is too large. Would you need to see the class?
Thanks a bunch.