phetsims / collision-lab

"Collision Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

Restart vs Reset #76

Closed brandonLi8 closed 4 years ago

brandonLi8 commented 4 years ago

It is time to implement the restart button. As far as I am aware of, these are the differences from between the reset and restart button:

Reset:

I'm going to implement this as written above for now.

brandonLi8 commented 4 years ago

In the commits above, I added the restart functionality described above.

I should clarify one thing: the ball states are saved when the sim goes from paused to playing. This is normally achieved when the user presses the play button, but can also be achieved when the user drags a ball when the sim is playing, which pauses the sim when the user is dragging and plays it again when the user drops it (since it was playing). In this case, pressing the restart button will put the ball at the spot it was dropped.

@arouinfar please review in https://phet-dev.colorado.edu/html/collision-lab/1.0.0-dev.8/phet/collision-lab_en_phet.html

arouinfar commented 4 years ago

@brandonLi8 this is looking nearly perfect. The only thing that's a bit strange is that adjusting the mass with the slider will not save the state, even though editing it with the keypad does.

What would you think about pausing the sim when the slider is adjusted? It seems like that would take care of the state saving issue.

brandonLi8 commented 4 years ago

What would you think about pausing the sim when the slider is adjusted? It seems like that would take care of the state saving issue.

I agree and it would work really seamlessly in the code. Doing that now.

brandonLi8 commented 4 years ago

Done in the commit above. Closing.