Quote:
Originally Posted by smasher
You have an array of rocks; you need to loop through the array and check each rock against the elephant. Something like the loop in this post:
http://www.iphonedevsdk.com/forum/ip...tml#post150018
ZunePod: newView doesn't need to be in the .h file, because it's just a temp variable we're using to create the new views. The array meteorArray should be in the .h file, though.
|
I dont know what is wrong, the console dosent say Collision, when the Fallingimage hit the Elephant?
Code:
-(void)CheckCollision {
for (int i = 0; i< [objectsArray count]; i++){
UIView* currentBomb = (UIView*)[objectsArray objectAtIndex:i];
if(CGRectIntersectsRect(currentBomb.frame, Elephant.frame)){
NSLog(@"Collision ");
}
}
}