문제

I am moving my sprite using CCBezierTo:

    id streakAcross = [CCBezierTo actionWithDuration:myDuration bezier:bezier];

I would like to modulate (sinusoidal?) the sprite along the path or rather introduce a smooth wobble that moves the sprite along either side of the bezier path. I think I can spawn a ccmoveby action simultaneously, but have not gotten my head around it.

도움이 되었습니까?

해결책

I have solved this by embedding the sprite inside a ccnode. The sprite is animated up and down (forever) using CCMoveBy-s relative to it's parent. Then I animate the parent node along the bezier path. I added an ease out action to smooth things out.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top