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?