Hi,
What I want a player (CCSprite) to be moving around the screen, and if he goes out the window, to make him appear in another "Scene". I don't know if the best way to do this is to have multiple scenes and change them or have multiple layers and edit their "z", for now I am going to call them "Scenes". Because in single level, I want the player to be able to go out of the window (change the "scene") to take some object and return to the first "Scene". What I don't want is the cam to move around. And if the level has two "Scenes", can I do an array of "Scenes". I hope someone can help em :)
Change scene if a Sprite goes out of the screen
(5 posts) (2 voices)-
Posted 1 year ago #
-
It depends on what you really want your end result to be.
Do you want transitions between these 'areas' (scenes as you say)? If so, you may want them to be scenes themselves. (But if you have many of these that make up a level, and many levels, that wouldn't be a good approach)
You could just have all these 'areas' contained on a layer in one scene, and simply move that layer when appropriate.
Posted 1 year ago # -
mmmmm, good idea. In a single level, there can be about 9 or 12 "areas", so it is better to make a layer and move. The thing of the transition..., a fade in transition could be better, but if the next "area" just pops it is ok, because is possible to make the camera change from a point to another one with a fade in trans? Perhaps if i fade in a screen white, change the cam and then fade out back to the map?
Posted 1 year ago # -
You could get the 'fade' effect if you'd like by being clever with opacity and a white sprite to fill the screen.
I think overall performance would be best if you created your whole level in a single layer, and when you wanted to between 'areas', you would fade in the white image from clear to opaque, move the layer to snap to the next area, then fade the white image's opacity back to 0 and remove it. This being an alternative to having each area as a scene.
Otherwise, (and I could be wrong here) I think the built in cocos2d transition effects are just for transitioning between scenes.
Posted 1 year ago # -
Ok, tanks you very much! Ill tell you what I finally do :)
Posted 1 year ago #
Reply
You must log in to post.