CCScene* newScene = MyGameScene::create(); // create a new scene CCDirector::getInstance()->replaceScene(newScene); // replace the old scene with the new one oldScene->release(); // release the old scene
CCScene* scene = MyGameScene::create(); // create a new scene CCDirector::getInstance()->runWithScene(scene); // set the scene as the current scene CCDirector::getInstance()->end(); // remove the scene delete scene; // delete the sceneIn this example, we create a new game scene and set it as the current scene. We then remove the scene and delete it from memory. The package library used in these examples is cocos2d-x.