A scene is the basic high-level CCNode
object. All other nodes are considered children of a scene. Only one scene can be running at a time. Scenes are managed using a stack data structure. In this recipe, we will see how to push and pop scenes onto the stack.
Execute the following code:
// TreeSceneMenu // The node for our binary tree of scenes @interface TreeSceneMenu : CCLayer { NSString *name; } +(id) sceneWithString:(NSString*)str; -(id) initWithString:(NSString*)str; -(void) goToScene1:(id)sender; -(void) goToScene2:(id)sender; -(void) back:(id)sender; @end @implementation TreeSceneMenu +(id) sceneWithString:(NSString*)str { //Initialize our scene CCScene *s = [CCScene node]; TreeSceneMenu *node = [[TreeSceneMenu alloc] initWithString:str]; [s addChild:node z:0 tag:0]; return s; } -(id) initWithString:(NSString*)str { if( (self=[super init...