phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

RewardNode should support Emitter #58

Closed samreid closed 7 years ago

samreid commented 7 years ago

Discovered in phetsims/axon#102 RewardNode uses an Events argument for driving the animation. PropertySet extends Events but will no longer be used, and Events is deprecated. RewardNode should support Emitter.

samreid commented 7 years ago

I added support in https://github.com/phetsims/vegas/commit/7a585d97cacca47bbd6d751c15ef9a2a72081578 . Hopefully this won't disturb existing usages of RewardNode, but it should reviewed. @jbphet @jonathanolson @pixelzoom @jessegreenberg can you please review the changes?

pixelzoom commented 7 years ago

So now we have support for both Events (stepSource) and Emitter (stepEmitter). Rather than adding support for Emitter, why not replace Events with Emitter? I see only 1 usage of stepSource, in fraction-matcher.

samreid commented 7 years ago

Thanks, you are right--it looks like stepSource can be removed now.

samreid commented 7 years ago

I removed stepSource and confirmed Fraction Matcher still animates the reward. @pixelzoom would you like to review at your convenience?