iPhone Programming - UIImageView Collison HD

17.02.2011
A tutorial teaching you how to detect image collision and do something about it. Useful for Game Apps. Main Code Used: -(void)ifCollided { if (CGRectIntersectsRect(image.frame, collisionImage.frame)) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Collided" message:@"You have collided with another image" delegate:self cancelButtonTitle:@"Reset" otherButtonTitles:@"Ok" ,nil]; [alert show]; [alert release]; } } -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)index { if (index == 0) { image.center = CGPointMake(159, 279); } } In Other Actions: [self ifCollided]; Next Video: http://www.youtube.com/watch?v=Cw4zUZM0r-w First Video: http://www.youtube.com/watch?v=H1wOlmwN94o Link: http://developer.apple.com/devcenter/ios/index.action Website: http://failcake.webs.com/ Twitter: http://twitter.com/failcakeapps Channel: http://youtube.com/milmersxcode

Похожие видео

Показать еще