0

I am working with Cocos2D v1.0.1 and I have a bug with this code

CCScene *scene = [TDGameHandler scene:kGameSolo andViewController:self];
if(![[CCDirector sharedDirector] runningScene])
{
    [[CCDirector sharedDirector] runWithScene:scene]; // RUN THE SCENE

} else {
    [[CCDirector sharedDirector] replaceScene:scene];
}

The first time there is no problem, but the second time there is no image load. I tried to pop and push the scene but it didn't work either, I also tried to add startAnimation but the application crash.

enter image description here

I just tried to end the CCScene with this code :

[[CCDirectorIOS sharedDirector] end];
[[CCDirector sharedDirector] runWithScene:scene];

But it crash.

Thanks for your help.

2
  • 1
    So how do you create the image in your scene, and how do you create the scene? Post that code.
    – CodeSmile
    Dec 19, 2013 at 15:27
  • I add in my answer how I initialise the scene, and I have a lot of image in the game added in various way. Even after the game is launch, no image can be load.
    – Pull
    Dec 19, 2013 at 16:04

1 Answer 1

0
try this:


[[CCDirector sharedDirector] replaceScene: [TDGameHandler scene]];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.