I am making a game for iOS. I inputed two images, one will be used as the player, and the other which is an object. I want to code that if the two objects intersect, then it runs the method EndGame
.
-(void)Collision{
if (CGRectIntersectsRect(Ball.frame, Platform1.frame)) {
[self EndGame];
}
}
Although, The images are not a square shape, but the UIImage is a square. Therefore when the two objects intersect it Ends the game, even if the two images look like they came close it still ends the game because of the incorrect collision detection. Do you have suggestions?
Can I change the image shape on XCODE or can I make it so if the image collides with a certain point on the players image?
Thanks.