Creating single bodies cocos2dx

General discussion about the R.U.B.E editor
Post Reply
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
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 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

How to import a body set from another b2dworld?

Loading two json:

Make some bodies unload:

Can we reuse the bodies from different json files?

How to shift x position at runtime
Post Reply