2D Breakout collision problem

Started by
9 comments, last by CloudNine 20 years, 8 months ago
I made my 2d-colissionsystem as such:

Store the "radii''s" ie, the length from the center of the object to the left/right edge and from the center of the object to the top/bottom. Each frame you test the two objects radii''s against eachother, if BOTH the x and the y radii''s overlap, there is a colission. This is only for bounding boxes though but that seems to be what you want? You will get pixel-perfect colissions with this unless the speed is so great the ball will "move through" the bat.

This also eliminates this error:

      |-------|      |       |  |----------------|  |   |       |    |  |   |       |    |  |   |       |    |  |----------------|      |       |      |-------| 


Ok these objects got no vertices inside eachother, some systems would not recognize a colission in this.
----------------------------
When hell freezes over it will be a pretty cool place to snowboard

This topic is closed to new replies.

Advertisement