Cocos2d x C++ Custom Physics Bodies is Error

  • sodane
    Likes 0

    Problem Description

    https://www.youtube.com/watch?v=NH95JTCCQvo

    (Cocos2d x C++ Physics Tutorial 13 - Custom Physics Bodies 11:00)

     

    auto ballSpr = Sprite::create("ball.png");

    ballSpr->setPosition(Vec2((visibleSize.width /2 +origin.x) +0 *deviceScale, (visibleSize.height /2 +origin.y) +0 *deviceScale));

    MyBodyParser::getInstance()->parseJsonFile("t.json");

    auto ballBody = MyBodyParser::getInstance()->parseJsonFile(ballSpr, "t.json", PhysicsMaterial(1.0f, 0.0f, 0.0f));

     

    // !Error (Too many arguments to function call, expected single argument 'pFile', have 3 arguments)

    auto ballBody = MyBodyParser::getInstance()->parseJsonFile(ballSpr, "t.json", PhysicsMaterial(1.0f, 0.0f, 0.0f));

     

    Help me.

     

     

  • Sonar Systems admin
    Likes 0

    Did you try the code from the GitHub page?

Login to reply