RUBE as object creator

General discussion about the R.U.B.E editor
Post Reply
milos
Posts: 3
Joined: Wed Feb 04, 2015 12:03 am

RUBE as object creator

Post by milos »

Hi,

RUBE is great tool. But i'm not quite sure how to do what i want. So, i have dynamically created world within my game, terrain is randomly generated. And i want to use RUBE as obstacle designer. So i would like to create obstacles made from multiple bodies/joints, but the thing is that i would also like to move it as a single object, and not every body separately. So for example if i have a ramp with an elevator i would like to spawn all of the on specific location, since my world is randomly generated, and render appropriate images for each body.

Is it possible to do something like that ?

Thanks
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: RUBE as object creator

Post by iforce2d »

Hi Milos

Box2D does not have any concept of an 'object' made of multiple bodies, so the only way to move a structure of bodies is to move all the bodies that are part of it. You can make a RUBE scene for each of your objects and move all bodies in that scene after loading. This thread might be helpful: viewtopic.php?f=6&t=379
milos
Posts: 3
Joined: Wed Feb 04, 2015 12:03 am

Re: RUBE as object creator

Post by milos »

Yeah i know,

I ended up modifying b2json file with additional parameter (b2Vec2 position) and when loading a single json file/string, i just pass position where i want to be spawned, of course this is applied to all bodies from single file.

Thanks :)
Post Reply