Follow question/answers here, I'm able to create an infinite vertical scroll already, but just for one background image. Now I move to a new problem. I have multi background frame image, like 7 frames to complete a background scroll animation. I can run animation as an endless animation aswell just follow this:
-(void)scrollBackground:(ccTime)dt
{
timeWaited+=dt;
if (timeWaited<FRAME_RATE) {
return;
}
timeWaited = 0;
bgIndex++;
if (bgIndex == 7) {
bgIndex = 0;
}
CCSprite* bgSprite = bgSprites[bgIndex];
bgSprite.zOrder = LAYER_BACKGROUND;
}
But it look very jerky and actually dont look like it's running forward, I think i may need to scroll each sprite a little before replace it with new sprite, Or may be i need to zoom each sprite a bit to fit new sprite