Page 1 of 1
					
				Can we reuse the bodies from different json files?
				Posted: Sun Oct 06, 2013 12:12 pm
				by shefchenko
				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 

 
			 
			
					
				Re: Can we reuse the bodies from different json files?
				Posted: Sun Oct 06, 2013 2:55 pm
				by iforce2d
				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.
 
			 
			
					
				Re: Can we reuse the bodies from different json files?
				Posted: Sun Oct 06, 2013 3:17 pm
				by shefchenko
				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.