2
我正在使用CCSequence操作,我希望我的精灵按住特定的动作,同时触摸并按住并在触摸结束后继续序列。cocos2D CCSequence触摸并保持一段时间
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
id downward = [CCRotateTo actionWithDuration:0.1 angle:45];
id straight = [CCRotateTo actionWithDuration:0.1 angle:0];
id stable = [CCSequence actionWithDuration:1.0];
id upward = [CCRotateTo actionWithDuration:0.1 angle:-45];
id Seq = [CCSequence actions:downward, straight, stable, upward, nil];
[mySprite runAction:Seq];
}
-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event{
}
我想要这个“id stable = [CCSequence actionWithDuration:1.0];”在Touch处于保持状态时用浮动时间间隔替换。并在触摸结束时重置。
任何帮助,非常感谢。