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處於保持狀態時用浮動時間間隔替換。並在觸摸結束時重置。
任何幫助,非常感謝。