# collision between two objects

to test collision i am using intersect function.

if(this.getBounds_ball().intersects(this.getBounds_rect()))
{


but the problem is i dont know how to test where the ball is collision from. i was thinking it will have a if statment inside to check if ball is collsion from left. another for right, top and bottom. so 4 if statments? but i dont know how to code it. any ideas? any ideas?

• Asking a broad, "how-to-do-this" question is generally not permitted on this site; please see the faq. However, more specific questions about pong, brick-breaker et al. are thoroughly covered. Try this search, see if it helps you find what you need. Pong Collision – Seth Battin May 29 '13 at 18:02

xOverlap = boundsA.X - boundsB.X;