Closed brandonLi8 closed 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
@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.
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.
Done in the commit above. Closing.
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:
Like a traditional sim, this resets the all model Properties back to the values that they were initialized to
Restart:
I'm going to implement this as written above for now.