Physics on Cocos2d-x v3.2

Hello everyone,

I’ve maked some games with cocos2d-x v2.x and all the times i’ve used box2d and physics editor to create the shapes.

At the time im creating a new game with v3.2 and i have some doubts:

1- what is the best bet? Use box2d or Cocos2d-x integrated physics?

2- if i want to use box2d how i can enable its integration if im already working in a new v3.2 from scratch game without activating them on the initial setup? I think the box2d is pre-bundled with cocos2d-x

3- what is the best physics editor for v3.2? Physics Editor or R.U.B.E?

4- Has the Physics Editor a loader for integrated physics of v3.2? And for box2d In v3.2?

Regards for the help

the v3.2 integrated Physics Engine is based on Chipmunk, not Box2d. Although I think the API is more similar to Box2d naming conventions.

There was a thread a few days back about turning off integrated physics and using Box2d

http://discuss.cocos2d-x.org/t/cocos2d-v-3-how-to-enable-box2d/15597/14

Thank u for your answer.

At This time i already make some games with box2d and no problem. I only use a chipmunk based physics In a game that i made In cocos2d-swift v3. What is the best physic engine for u guys?

And about the editor: has the physics editor from code’n’web a loader for cocos2d-x v3.2 integrated physics or only for box2d?

Is R.U.B.E editor a good editor to chose?

Regards

R.U.B.E is box2d I’m not really sure about Physics Editor by Code n Web. I’ll e-mail Andreas and ask him to reply to this thread about his own product.

You can use PhysicsEditor with all 2d PhysicsEngines.

Unfortunately we had not time yet to adapt the loader code to Cocos2d-x.
We have an example running on Cocos2d-swift here:

The whole code and exporter is available from github:

It should really be easy to adapt it for cocos2d-x.

The loader itself can be found here:
https://github.com/CodeAndWeb/PhysicsEditor-Cocos2D-V3/blob/master/PhysicsEditor-Cocos2D-V3/Classes/GCCShapeCache.m

It’s basically taking the values out of the plist file and attaching them to the physics bodies…

Hello Andreas,

Thank u for your answer.

I already decide that i will use box2d. I found your GB2ShapeCache-x in github but have to be ported to support cocos2d-x v3 (replace CCArray, CCString, CCDictionary Etc).

Another question: Do you plan support joints in physics editor?

Regards

i did port back then to v3

1 Like

That’s awesome. I hope I find some time to write a tutorial for it…

Hi Andreas, did you manage to write that tutorial? Having trouble to find good tutorial for cocos2d-x using PhysicsEditor, looks like they are all for Cocos2D