Skip to content

Instantly share code, notes, and snippets.

@nathanclark
Created November 6, 2012 21:03
Show Gist options
  • Save nathanclark/4027519 to your computer and use it in GitHub Desktop.
Save nathanclark/4027519 to your computer and use it in GitHub Desktop.
#import "CCScene.h"
#import "Fly.h"
@interface PageScene1 : PageScene
Fly *fly;
@end
#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