Automatically pause when loading from code?
Automatically pause when loading from code?
As the subject says, is there a way to add a line to the code so that when it is loaded, the sim starts paused? Or is there something I can do before I load the code to ensure it will be paused when I load it? Thanks for any help!
- testtubegames
- Site Admin
- Posts: 1139
- Joined: Mon Nov 19, 2012 7:54 pm
Re: Automatically pause when loading from code?
There's not a line of code, but (in theory) -- if the sim is paused before you open the save/load panel, it'll remain paused when you load a setup.
Re: Automatically pause when loading from code?
Maybe it does that in the Full Version? I'm using the web version, and can't get it to do that. To be clear, the only way to open up the save/load panel is to hit escape, and do it from the main menu?
Re: Automatically pause when loading from code?
I'm realizing that this isn't actually the biggest deal. I'm creating an activity for my students to explore gravitation (actually modifying one that we used to do using My Solar System from PhET, which has unfortunately not been converted to HTML5). The code isn't super complex, so I can just have them either edit the code to make changes to the initial conditions, or they can figure out how to reset the objects to the initial conditions themselves and then make changes. But still, having a reliable way to ensure that the simulation starts paused would be the most ideal solution.
- testtubegames
- Site Admin
- Posts: 1139
- Joined: Mon Nov 19, 2012 7:54 pm
Re: Automatically pause when loading from code?
Ah, interesting. It looks like the behavior is different depending on which way you access the load panel. If you go out to the main menu, as you describe, it always starts playing automatically.
The way you'd want to do it is use the save (& load) button in the upper-left menu. That will preserve the sim's paused state.
The way you'd want to do it is use the save (& load) button in the upper-left menu. That will preserve the sim's paused state.