Instantiable object as sub-scene

What would you like to see in future versions of the editor?
Post Reply
metalbass_92
Posts: 18
Joined: Wed Dec 26, 2012 12:27 pm

Instantiable object as sub-scene

Post by metalbass_92 »

Hi,

when i've seen the "Instantiable objects" feature on the voting page i thought that it could be implemented in terms of a whole rube scene, that way you would only need to refer to the file name and avoid all the redundant information between the various instanced objects.

I've also thought that storing world information in all of them would be quite a waste, right?

Btw way, i love the whole Voting thing!
Xavier Arias
Cocos2d-x Game Programmer
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Instantiable object as sub-scene

Post by iforce2d »

The 'instantiable object' would behave like a template that could be used to place many similar things around the scene, all referencing the same master object template. Editing the master object would cause all instances of that object in the scene to be changed. So in the .rube/.json file, there would be only one occurrence of the template itself, and a list of the locations that an object should be placed. I don't think there is anything redundant there.

Yes, I guess you could save these master objects in separate files, then they could be shared between different scenes. Right now the top level object in a .rube file is expected to be the world, but in future perhaps this could be modified to allow loading of individual bodies, fixtures, images... and 'objects'.
metalbass_92
Posts: 18
Joined: Wed Dec 26, 2012 12:27 pm

Re: Instantiable object as sub-scene

Post by metalbass_92 »

I was talking about redundancy because i've been using a cocos2d with box2d tool that uses definitions of bodies from a file and then it includes those definitions as a copy everywhere they are used in the level.

I think it's the easier way to implement, so i was (kinda) offering a better way than that.
The way you're taking sounds pretty good to me :lol:
Xavier Arias
Cocos2d-x Game Programmer
Post Reply