Combine several SKScenes in Sprite Kit

I am currently struggling with the following problem:

I am creating a Sprite Kit game in Objective-C , in which I have to use a parallax-animation in all 3 scenes. I use clouds with randomly generated X and Y positions. They appear in the greeting scene, in the game scene and in the highscore scene.

Problem: whenever I switch from one scene to another, I have to restart the parallax-animation, which leads to an messy interruption.

What might be the best strategy to keep the "cloud scene" running all the time in the background, no matter how many times you switch between the game scenes?

Thanks in advance.


For this purpose, consider using only one scene and for each game theme (ie greeting, game, highscore) use an SKNode which will contain the required elements for its purpose (eg the greeting node will have its greeting elements).

This way you can easily keep a "constant" SKNode (ie add it once to the scene when the game is first loaded) which will contain your parallax clouds and add/remove required node for the greeting game and highscore when necessary

链接地址: http://www.djcxy.com/p/30330.html

上一篇: MongoDB InvalidDocument:无法编码对象

下一篇: 在Sprite Kit中结合几个SKScenes