Game Development Reference
In-Depth Information
4. It's time to add some more action to make the game exciting. Now we will make
the block paddle move based on touch. The following functions will help us to ac-
complish this:
-(void)touchesBegan:(NSSet*)touches
withEvent:(UIEvent*)event;
-(void)touchesMoved:(NSSet*)touches
withEvent:(UIEvent*)event;
-(void)touchesEnded:(NSSet*)touches
withEvent:(UIEvent*)event;
These methods provide the callback when you touch the screen and also provide
the list of the objects which were touched. There are three callbacks for touch be-
gin, touch move and touch end action.
5. Now add the following code just before the @implementation line in
GameScene.m file:
@interface GameScene()
@property (nonatomic) BOOL isPaddleTapped;
Search WWH ::




Custom Search