Search code examples
iphoneobjective-ciosxcode4cocos2d-iphone

Cocos2d, I forgot what the command was for delaying a scene


I want the game over scene to not show up for a few seconds so you can actually see how you died. I remember doing this a while back but I can not remember for the life of me.

        GameOverScene *gameOverScene = [GameOverScene node];
        [gameOverScene.layer.label setString:@"You Lose"];
        [[CCDirector sharedDirector] replaceScene:gameOverScene];         

Really appreciate it.


Solution

  • Not getting what exactly you need. Still suggesting these two..try

    [self performSelector:@selector(showGameOverScene) withObject:nil afterDelay:2.0f];
    

    Replace with time:

    [[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:[GameOverScene scene] withColor:ccWHITE]];