As mentioned in the previous recipe, scenes are the root CCNodes and only one can be running at a time. When switching between scenes, we can apply transitions to make the scene change more explicit and stylish. In this recipe, you can demo all of the built-in scene transitions.
Execute the following code:
@implementation TransSceneMenu +(id) sceneWithString:(NSString*)str withCurrentTransition:(int)ct { //Create scene CCScene *s = [CCScene node]; TransSceneMenu *node = [[TransSceneMenu alloc] initWithString:str withCurrentTransition:ct]; [s addChild:node z:0 tag:0]; return s; } -(id) initWithString:(NSString*)str withCurrentTransition:(int)ct { if( (self=[super init] )) { name = str; currentTransition = ct; /* CODE OMITTED */ } return self; } -(void) prevScene:(id)sender { currentTransition--; if(currentTransition...