Hello guys, I'm going to use R.U.B.E, but I'm not sure for something - when I create every level in separate json file, is there any way to reuse the bodies from different json files, or every time at the end of level I should delete bodies generated from rubeLoader and create them again in next level. Is there a better way for this situation when creating levels with RUBE?
And thank you iforce2d for great editor
Can we reuse the bodies from different json files?
-
- Posts: 2
- Joined: Sun Oct 06, 2013 12:01 pm
Re: Can we reuse the bodies from different json files?
It sounds like you want to keep subsets of bodies in different files and load them in together. If so, there have been some other threads here about this which might be good to look at:
Loading two json:
viewtopic.php?f=6&t=176
How to import a body set from another b2dworld?:
viewtopic.php?f=6&t=153
Make some bodies unload:
viewtopic.php?f=6&t=188
If that's not what you meant, maybe you could say what you mean by 'better' way. Box2D has no way to transfer existing bodies between worlds directly, so the only way is by creating them afresh in the new world.
Loading two json:
viewtopic.php?f=6&t=176
How to import a body set from another b2dworld?:
viewtopic.php?f=6&t=153
Make some bodies unload:
viewtopic.php?f=6&t=188
If that's not what you meant, maybe you could say what you mean by 'better' way. Box2D has no way to transfer existing bodies between worlds directly, so the only way is by creating them afresh in the new world.
-
- Posts: 2
- Joined: Sun Oct 06, 2013 12:01 pm
Re: Can we reuse the bodies from different json files?
I will look these threads now, and yes, this is what I mean. So I can't reuse bodies from one world to another Thanks for reply.