I'm creating a program that contains multiple instances of an object. These instances spawn in a while loop and I want to say if ANY one of those instances is touching object x then do delete all further instances which I plan to do by using the break method in the loop.
The problem I'm finding is that there is no direct way to say if ANY of the instances are touching object x. I was wondering how you guys would work around this problem.
I had a similar problem like this in this same program and I fixed it by creating a for loop that runs equal to the maximum number of times that instance can be on the field and in that loop, it says to create a separate pointer to each of the instances and then give them all the condition I want them to be in. Note however that I said a similar problem, and that I don't think that this method will work on my given example.
