phetsims / wave-interference

"Wave Interference" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
19 stars 5 forks source link

Don't play the "squishy button sound" if another sound would be generated, or if another sound is ending due to the button press #489

Closed samreid closed 4 years ago

samreid commented 4 years ago

From today's meeting: Don't play the "squishy button sound" if another sound would be generated, or if another sound is ending due to the button press

samreid commented 4 years ago

@jbphet indicated this can be done by passing an object with a play() method, and handling the condition there:

    const p = {
      play() {

      }
    };
    const buttonOptions = {
      centerY: sourceNode.centerY + buttonOffset,
      left: buttonPosition,
      radius: WaveInterferenceConstants.WAVE_GENERATOR_BUTTON_RADIUS,
      content: pulseIcon,
      touchAreaDilation: WaveInterferenceConstants.WAVE_GENERATOR_BUTTON_TOUCH_AREA_DILATION,
      baseColor: WaveInterferenceConstants.WAVE_GENERATOR_BUTTON_COLOR,
      soundPlayer: p
    };
samreid commented 4 years ago

Implemented above and ready for review. @emily-phet can you please test on phettest, and close if all is well?

emily-phet commented 4 years ago

@samreid - all is well - closing.