This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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.
Joined: Sep 24, 2012
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.