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.
Cocos2d move sprite along bezier with "modulation" or wobble
-
22-07-2023 - |
Domanda
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.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow