Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newbie80

macrumors member
Original poster
Mar 2, 2011
51
0
Hi,

I would like to know how do I detect the center point of the first object collide with the center point of the second object? Coz the following code only shows any side of the object touches the other one. Any help would be thankful. :)

Code:
if (CGRectIntersectsRect(box1.frame, ball.frame) && soundCounter==1){
		CGPoint newCenter = CGPointMake(-50, -50);
		box1.center = newCenter;
		[box1 removeFromSuperview];
		}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.