Think more in terms of "intersecting", "overlapping", and "touching" rather than "colliding". Similar concepts but the math is easier if you think in terms of two shapes' PRESENT states (the terms I've used) as opposed to "colliding", which requires more thinking in terms of PAST states and motion. Make it … Read More
You can check for the two `Shapes` (ellipse and rectangle) intersecting. Which side is then just a tedious testing of the x and y coordinates.
Bouncing off a side of a rectangle (assuming it;s horiontal/vertical) is trivial (1), but bouncing off a corner is a different question. If you get … Read More
> I was hoping thier was going to be an easy way to go about this.
"Easy" is relative. As I think I mentioned, if the rectangle is vertical/horizontal as opposed to at an angle, it is considerably easier. But still not trivial.
Regarding bouncing off a corner, I think … Read More
The more I think about it, the more I like James' idea of letting Java do a lot of the math work as far as figuring out whether things intersect. In Java, as in math, a Rectangle is a Polygon, which is simply a closed Shape made up of line … Read More
Have a look at java.awt.geom.Area - it implements Shape but represents a closed shape at a particular position. It has all kinds of useful methods that Shape doesn't have, including area.intersects(other area)
Here's code I used a while back to do an exact check on collision between two arbitrary Shapes. … Read More