Well, assuming that you do actually have some entries in both lists, the problem is obviously that the intersects() method is always returning false. So you would need to find out why. Since that's a method of java.awt.Rectangle (am I right?) that would mean that you are always asking it whether two non-intersecting rectangles intersect. You would need to look at the rectangles to see why that is.
Again, that's assuming you are actually passing non-empty lists. You ought to check that as well, a little bit of debugging would work well here.
Yeah best to just do some debugging, print out the bounds of each rocket and projectile in your lists, so you can manually see if they intersect.
posted 6 years ago
Thanks for the help guys. I have attached a screen shot of the projectile just as it touches the rocket. The numbers in the top left are the coordinates of the rocket (top) and projectile (bottom). (The rocket is a gray square for now)
I am pretty sure that the arraylists contain something because the projectiles and rockets are all rendered from the arraylist and removed when they are not on screen which indicates that the arraylist does contain some entries.
I just had the craziest dream. This tiny ad was in it.
Devious Experiments for a Truly Passive Greenhouse!