1

Using the [CCParallaxNode node] class in cocos2d, I know how to add sprites to the parallax. But I was adding them BEFORE the character started moving with offset set to 0:

[parallaxBack addChild:ground1 z:1 parallaxRatio:CloseElementsSpeed positionOffset:L4];
 [parallaxBack addChild:ground2 z:1 parallaxRatio:CloseElementsSpeed positionOffset:L5];

Now, I am trying to add a new sprite after the character has already started to move. I probably don't add the character to the right position. How can I add a new sprite with an offset to the current position of the parallax? (I have tried to subtract its current position - it didn't work.)

//new sprite after a while - I can't see the character.
[parallaxBack addChild:man z:1 parallaxRatio:CloseElementsSpeed positionOffset:L4];
4

0 回答 0