HaxeFlixel / flixel-addons

Additional classes for HaxeFlixel
170 stars 136 forks source link

Enhancing FlxScene ? #142

Open davellx opened 9 years ago

davellx commented 9 years ago

Hello,

as I was trying to work with FlxScene, which is an excellent idea, I felt I lacked some specific purpose. Especially on the "entity" tag where I would like to declare specific variables, more than just FlxSprites properties. I was thinking of two different ways to do that : 1/ the first is really simple, we add a "data" attribute to the "entity" tag and if the data property exists we just transfert it after the creation. it could be from simple short text to complex json if needed. Simple and i believe quite short to code. 2/ the second one is more complex but maybe more interesting. Actually the list of properties transfered from the tags of the XML to the objects is fixed. Maybe it's possible to make this transfer more dynamic by just looking at the attributes, verifiying their existence in the target object and transfering it... automatically ? I think it wouldn't change the usage of the current code and be more flexible if the objects, even those that already exists (FlxText, FlxSprite, etc...), have to change in the future.

Before starting to code this for myself, I was wondering... what do you think ?

AndreiRegiani commented 8 years ago

Sorry for the late reply! I haven't seen this request before, btw I'm the author of FlxScene.

The dream is to make a dedicated HaxeFlixel scene editor (WYSIWYG) for any type of game, before starting that we want to have a solid and stable XML definition and parser (FlxScene).

About custom attributes, we definitely need it, I think we should go with type 2.

Any more ideas?