Created
November 6, 2012 21:03
-
-
Save nathanclark/4027519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CCScene.h" | |
#import "Fly.h" | |
@interface PageScene1 : PageScene | |
Fly *fly; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "PageScene1.h" | |
@implementation PageScene1 | |
- (void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
UITouch* touch = [touches anyObject]; | |
CGPoint touchLocation = [touch locationInView: [touch view]]; | |
CGPoint location = [touch locationInView: [touch view]]; | |
location = [[CCDirector sharedDirector] convertToGL:location]; | |
// Determine that this touch comes from a fly | |
if (CGRectContainsPoint( [fly boundingBox], location)) { | |
// animate tail if the touch is from a fly | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment