Creating single bodies cocos2dx

General discussion about the R.U.B.E editor
Post Reply
ashishchandy
Posts: 1
Joined: Tue May 26, 2015 6:43 pm

Creating single bodies cocos2dx

Post by ashishchandy »

I have a 2d endless runner game where obstacles are generated randomly.
The obstacles are of complex shapes ie circles and rectangles wont do for collision.
I want to create these bodies in the editor in separate json files.And import them into the game.
Just create simple objects in the editor and import them and create them randomly in my game.
The rest of the world will not be from RUBE just the objects.Is this possible?

For example in physicseditor you use images to create fixtures and the fixtures are saved in a plist.
In the game you create the body and the sprite and add the fixtures from the plist.

This is what I am looking for
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Creating single bodies cocos2dx

Post by iforce2d »

Yes, it's mentioned here http://www.iforce2d.net/b2djson/#merging and is probably the most common question on the forums... :)

These threads might be useful too (note that not all are relevant for cocos2dx, but they are about the same topic):

Instantiating bodies from a prototype in a RUBE document
viewtopic.php?f=6&t=125

How to import a body set from another b2dworld?
viewtopic.php?f=6&t=153

Loading two json:
viewtopic.php?f=6&t=176

Make some bodies unload:
viewtopic.php?f=6&t=188

Can we reuse the bodies from different json files?
viewtopic.php?f=6&t=254

How to shift x position at runtime
viewtopic.php?f=6&t=379
Post Reply