0

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
s60
  • 37
  • 2
  • 7
  • checkout this http://stackoverflow.com/questions/14897229/how-to-move-background-images-infinitely-in-ios-coco2d – Guru Nov 27 '13 at 14:26
  • I just added an answer to the referenced question. While it is about horizontal scrolling, it is very easy to apply the idea to this problem. – Ben-G Feb 08 '14 at 17:41

0 Answers0