What is the best way to make a if statement that activates when a shape hits the outer part of another shape or as some people may call it the outline

Lets say you are making a game where if a moving circle hits a rect it bounces off . Now the hard thing for me is to make the ball to do something if it hits the outline of the shape cause I need to make if x > x-width/2 (it there a easier way)

1 Like

Hello,

here is an online book: Collision Detection

maybe this can help you

Warm regards,

Chrisir

CrHallberg.com/CollisionDetection/Website/circle-rect.html