phetsims / friction

"Friction" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/friction
GNU General Public License v3.0
4 stars 6 forks source link

Mouse interaction alerts cannot run on endDrag #233

Closed zepumph closed 3 years ago

zepumph commented 3 years ago

From https://github.com/phetsims/friction/issues/231#issuecomment-920894882, we need to update FrictionDragListener so that we don't wait until endDrag to alert. Let's prototype with trying to do it every X drags. Otherwise we may just have to use the Utterance timing variables for this, but I don't see it as a good fit.

zepumph commented 3 years ago

From that comment:

I never hear the move-down hint, even when rubbing back and forth several times and I do not bring the books together.

zepumph commented 3 years ago

I have potentially fixed this with two items.

  1. I made it much more explicit when you get the "move down to rub harder" alert. It is solely based on the model contactProperty, and not based on the interaction.
  2. I made the timing of alerts for hints and border alerts be based on timing, instead of just the position when you end the drag (let go with the mouse). So instead it will attempt to alert every 3 seconds while dragging. I can change that number, but 4 felt too slow to response, and 2 felt too often.

Please review, and let me know if you want to talk through this. This is only on master right now, not on dev.15

terracoda commented 3 years ago

This sounds pretty good.

terracoda commented 3 years ago

@Matthew-Moore240 and @terracoda discussed, and we feel it would be better if there was some movement (some interaction) before you get move down to rub harder.

That said, if movement and space simultaneously are hard to detect we can live with it as is.

The main idea of the response is that it indicates unproductive rubbing. Having it fire with just air space seems a little extra directive, but not terrible.

Matthew-Moore240 commented 3 years ago

@terracoda @zepumph and @Matthew-Moore240 Reviewed this together and decided to leave it as is. Closing.

zepumph commented 3 years ago

https://github.com/phetsims/friction/commit/30ad85bdcd7a1f3ddbf4c2e205dfa8bb3de99281 doesn't seem to cut it to me. I was reviewing this code over in https://github.com/phetsims/friction/issues/242#issuecomment-933686906 and think it needs to be reworked. It will be done over in https://github.com/phetsims/friction/issues/253 where Utterance timing variables will be used instead of in house counting.