Citrus-Engine icon indicating copy to clipboard operation
Citrus-Engine copied to clipboard

Components.fla and Hero's dynamicFriction

Open gsynuh opened this issue 12 years ago • 3 comments

Charlie, on the forums, (http://forum.starling-framework.org/topic/need-help-to-convert-ce2-game-to-new-engine-napestarlingce#post-21544) reported that using Components.fla triggers a warning as Components have the dynamicFriction property... which obviously gets set with the setParams() function in CitrusObjects (or in ObjectMaker) ... But dynamicFriction is not an available public var upon construction (at least that's what I feel the problem is) so the message : "Warning: The parameter dynamicFriction does not exist on [object Hero]" would always be traced when trying to set dynamicFriction through params. and specially when loading levels made from Components.fla .

(I'm not using the right terms nor I am explaining myself right, but surely when we try this["dynamicFriction"] = 10; in the parent of this class, then public function set dynamicFriction doesn't exist yet so the "super" is not aware of that property and throws an error right?)

gsynuh avatar Jan 19 '13 15:01 gsynuh

That's weird because this works : [Inspectable(defaultValue="citrus.objects.platformer.nape.Enemy",type="String")] public function set enemyClass(value:*):void {

        if (value is String)
        _enemyClass = getDefinitionByName(value as String) as Class;
        else if (value is Class)
        _enemyClass = value;
    }

But not this.. [Inspectable(defaultValue="1.7")] public function set dynamicFriction(value:Number):void {

        _material.dynamicFriction = _dynamicFriction = value;
    }

alamboley avatar Jan 21 '13 08:01 alamboley

We've a warning but it works, very weird.

alamboley avatar Jan 21 '13 08:01 alamboley

yeah I didn't think of this one. My argument doesn't work then... so either dynamicFriction doesn't work, or enemyClass just works by magic... Or we simply missed something important and interesting

gsynuh avatar Jan 21 '13 14:01 gsynuh