0
votes

I have a scene which has a background with a gradient, as this bg scrolls past, the next bg is solid in colour. It is this solid bg that I want to continuously scroll, until the sprite comes back down to the first bg. Basically, it is a rocket on the ground with a sky going dark towards the top, then as the rocket is in space, the scrolling bg is solid dark until it comes back down to land. Is this possible without hacking it as I have already by making the stage massive and just placing multiple images:

CGRect worldYBoundary = CGRectMake(0, 0, _background1.contentSize.width, 2880);
[_contentNode runAction:[CCActionFollow actionWithTarget:_rocket worldBoundary:worldYBoundary]];

I hope this makes sense and someone can help, this coding feels very wrong.

1

1 Answers

0
votes

Maybe you could put your immovable background into a separate layer below all other layers/objects. Then your rocket can stay in the center of the screen and don't move, but instead you can move the layer with sky/atmosphere.

This way sooner or later your layer with sky/atmosphere will go of screen and only a rocket and solid immovable background will stay on the screen.

Then when the rocket will land you can move the sky/atmosphere layer up and it will seem like rocked entered atmosphere and lands.