retry button for multi level game

Cocos2d-x C++ Physics
  • ZrFire
    Likes 0

    Problem Description

    So i Create a “MenuItemImage” of a retry button in pause Scene when i click the button should to restart should restart the current level but i don’t know how to do it 

    void PauseScene::Retry(cocos2d::Ref* pSender)
    {
            auto scene = Level1Scene::createScene();
            Director::getInstance()->popScene();
            Director::getInstance()->replaceScene(scene);
    }

    I do like that but i want a method to restart every level 

    please help me 

    and thanks in advance 

    Using cocos2d-x v4 c++

Login to reply