Looking for physics tutorial made for recent cocos.

Looking for physics tutorial made for recent cocos.
0

Are there any tutorial on physics for recent cocos2d-x?
I find the information here incomplete : https://docs.cocos2d-x.org/cocos2d-x/v4/en/physics/collisions.html

For example, what does this line do? Where can I find the function? I assume the first parameter is position but what is the second parameter?

auto sprite = addSpriteAtPosition(s_centre, 1);

This is my custom made function for addSpriteAtPosition.

Sprite addSpriteAtPosition(Vec2 loc)
{
    auto sprite = Sprite::create("CloseNormal.png");
    sprite->setPosition(loc);
    auto spriteBody = PhysicsBody::createCircle(sprite->getContentSize().width / 2, PhysicsMaterial(0, 1, 0));
    sprite->setPhysicsBody(spriteBody);
}

How to show physics debug mode?

Can you please take a look at cpp-tests? There are plenty of working physics examples there.

In your IDE, can you right clock on addSpriteAtPosition() and say jump to definition? This should take you to where the function is implemented.

https://docs.cocos2d-x.org/cocos2d-x/v4/en/physics/debugging.html