So..... I have these sprites. Lets say 4 of those.
And it calls upon a function (void) bezier that is within a Ball Class that is a child of AtlasSprite. (It calls for each sprite object)
Before this function is called upon, these are just standing-still on their own starting positions. But once 'bezier' is called upon, they start bezier-ing....
- (void) bezier
{
ccBezierConfig bezier;
bezier.startPosition = ccp(0,0);
bezier.controlPoint_1 = ccp(random()%180 + (-30), random()%180 + (-120));
bezier.controlPoint_2 = ccp(random()%200, random()%200);
bezier.endPosition = ccp(random()%180 + 20,random()%200);
id bezierForward = [BezierBy actionWithDuration:random()%5 bezier:bezier];
id bezierBack = [bezierForward reverse];
id seq = [Sequence actions: bezierForward, bezierBack,nil];
id rep = [RepeatForever actionWithAction:seq2];
[self runAction: rep];
}
Now, when this function is called, sometimes one or more of the sprite object disappears from the screen,randomly. It only shows somewhere between 2~4 sprites (4 is the correct amount).
When I comment out the very last line([self runAction: rep];), it correctly shows 4 sprites 100% of the time. It won't be moving because its not actually calling upon the action, but all 4 are there. When I uncomment it out and run it, it randomly changes the number. Its always between 2 and 4.
So I was wondering if I were doing something wrong. It would be much easier if it were consistently in the number, but since its random so I can't pinpoint the cause.....