(prop :FlxStageFacing defaultFacing) (prop :FuzzyMap animationNames (new FuzzyMap)) (defNew [&prop :String assetPath &opt frameWidth frameHeight :FlxStageFacing defaultFacing :Map animations] (super) (set this.defaultFacing (or defaultFacing Right)) (if (and frameWidth frameHeight) (loadGraphic assetPath true frameWidth frameHeight) (loadGraphic assetPath)) (when animations (doFor =>name animationArgs animations (dictSet animationNames name name) (animation.add name animationArgs.frames (or animationArgs.frameRate 30) (or animationArgs.looped true) ?animationArgs.flipX ?animationArgs.flipY)))) (method :Void playAnimation [fuzzySearchKey] (if (animationNames.exists fuzzySearchKey) (animation.play (dictGet animationNames fuzzySearchKey) true) (#when debug (print "WARNING! No animation matches $fuzzySearchKey for actor with spritesheet $assetPath")))) (method :Void stopAnimation [] (animation.stop))