Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* GameEngine.m, assume GameEngine.h is complete */
- #import "GameEngine.h"
- #import "TouchHandler.h"
- @implementation GameEngine
- -(id) init
- {
- if(( self = [super init] ))
- {
- TouchHandler* touch = [[TouchHandler alloc] initWithTarget: self];
- [[TouchDispatcher sharedDispatcher] addTargetedDelegate: touch priority: 0 swallowsTouches: YES];
- }
- return self;
- }
- @end
- /* TouchHandler.m, assume TouchHandler.h is complete */
- @implementation TouchHandler
- @synthesize target;
- -(id) initWithTarget: (GameEngine*)newTarget
- {
- if(( self = [super init] ))
- {
- [self setTarget: newTarget];
- }
- return self;
- }
- //
- // Events go here, I don't really need to list them all
- //
- @end
Add Comment
Please, Sign In to add comment