Skip to content

Tag: collision-detection

How to check if two rectangles collide over the axis

I think I’ve got some kind of duplicate question, but I just can’t figure it out. So I got a Region class. This class contains four attributes. aX, aY and bX, bY. Now I want to produce a method doesCollide(Region other). I’ve tried many things, but can’t get it to work. I think it is, because the regions refer to