Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Random Rocks
View Single Post
Old 02-17-2010, 08:24 AM   #56 (permalink)
Sesa
Registered Member
 
Join Date: Nov 2009
Posts: 91
Sesa is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
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 ");
		}
		
	}
	
}

Last edited by Sesa; 02-17-2010 at 12:07 PM.
Sesa is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,485
Threads: 94,041
Posts: 402,628
Top Poster: BrianSlick (7,978)
Welcome to our newest member, jianjue
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:55 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.