Closed pixelzoom closed 7 years ago
Unless there's a reason to do things differently, the model should be instantiated in the createModel
argument, like this:
function PrismsScreen( tandem ) {
var options = {
name: prismsString,
homeScreenIcon: new Image( iconImage ),
navigationBarIcon: new Image( navbarIconImage ),
tandem: tandem
};
Screen.call( this,
function() { return new PrismsModel(); },
function( model ) { return new PrismsView( model ); },
options );
}
If there is a legitimate reason why it needs to be different, please document it.
Yes, this looks like a problem, I'll work on it this week.
FYI, similar problems in other sims: https://github.com/phetsims/neuron/issues/129, https://github.com/phetsims/resistance-in-a-wire/issues/76.
Those problems will interfere with the loading bar (if nothing else), we should address them.
Fixed above. I realized that the loading bar now goes by screen, so this would not have interfered. But if we break up the loading bar to load models and views separately, then this could have shown up as odd.
I tested the app by launching it after making this change, and all seems well.
Closing.
See PrismScreen constructor:
Note that
PrismsModel
is instantiated in the constructor (line 39), instead of in thecreateModel
function argument (line 42) toScreen
. This doesn't match the pattern used throughout PhET sims. Is there a reason for this deviation, or is it accidental?