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];" 터치가 보류 상태 인 동안 시간 간격의 부동으로 대체되었습니다. 그리고 터치가 끝나면 다시 설정하십시오.
도움을 주시면 감사하겠습니다.