سؤال

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