phetsims / buoyancy

"Buoyancy" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

Factor out the mass input listener from the screen view #104

Closed zepumph closed 1 month ago

zepumph commented 2 months ago

From https://github.com/phetsims/buoyancy/issues/78, adding mass drag sounds directly in the screen view helped see the break in modularity.

samreid commented 1 month ago

I factored out BackgroundEventTargetListener and it seems to be working in my testing. I noted several TODOs that would be good to check in about. Feel free to finish it up.

zepumph commented 1 month ago

I looked at things, and decided to "go all in" with two main changes:

  1. Provided only specific items of screen view (which allowed us to get rid of the parametric type).
  2. Use the constructor, and more instance fields to implement TInputListener.

Feel free to close.

samreid commented 1 month ago

Looks good, thanks. Closing.