I am using CGRectIntersectsRect to detect collisions in my game. It is a scrolling game, and I can't get my bounding box to match up with where it is supposed to be. What i am looking for is a way to make these CGRects (bounding boxes) visible. I tried doing the following:
-(void) drawBoundingBox: (CGRect) rect;
{
CGPoint vertices[4]={
ccp(rect.origin.x,rect.origin.y),
ccp(rect.origin.x+rect.size.width,rect.origin.y),
ccp(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height),
ccp(rect.origin.x,rect.origin.y+rect.size.height),
};
ccDrawPoly(vertices, 4, YES);
}
But it isn't showing up. What am I doing wrong? Cheers!