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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Basic hit test.
View Single Post
Old 02-06-2010, 06:24 AM   #1 (permalink)
ozzie
Registered Member
 
Join Date: Mar 2009
Posts: 140
Default Basic hit test.

Can anyone think why this isn't working? It's really simple but doesn't seem to work. The key is supposed to disappear when it touches the character which is animated by a simple UIView animation and it's called by:
Code:
[UIView setAnimationDidStopSelector:@selector(FinishedWalking)];
The problem is it seems to disappear almost randomly after you walk, even if you haven't collided with it. Heres the collision code:
Code:
-(void)FinishedWalking{
	if(CGRectIntersectsRect(Key.frame, Character.frame)){
		Key.hidden = YES;
		KeyObtained = YES;
	}
}
The key and Character and both inside the same UIView. Any help would be greatly appreciated.

Cheers,
Ozzie

Last edited by ozzie; 02-06-2010 at 06:27 AM.
ozzie is offline   Reply With Quote
 

» Advertisements
» Online Users: 270
16 members and 254 guests
ADY, BdR, BrianSlick, dacapo, F_Bryant, ilmman, Joseph Nardone, laurielaptop, M@realobjects, oztemel, poisenden, rob.mccarthy, Sunny46, TheWebWizz, VikMyr, XRumerTest
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,701
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

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