我有一个像下面的一些代码:
-(void) createBall {
_ballSprite = [SKSpriteNode spriteNodeWithImageNamed:@"ball0001"];
_ballSprite.position = CGPointMake(firstNode.position.x, firstNode.position.y);
SKAction *ballScale =[SKAction scaleXTo:-0.5 duration:0];
SKAction *ballMove = [SKAction moveByX:0 y:-300 duration:0];
SKAction *ballMoveScale = [SKAction sequence:@[ballScale,ballMove];
SKAction *ballScaleMove = [SKAction sequence:@[ballMove,ballScale]; //Unused variable
[_ballSprite runAction:ballMoveScale];
[self addChild:_ballSprite];
}
现在我该怎样让跑出来,从侧面如说ballScaleMove。 在touchBegan处理器内部或在initWithSize ..等?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
///here maybe
[_ballSprite runAction:ballScaleMove]; // Error undeclare identifier 'ballScaleMove';
}