Skip to content

Commit

Permalink
Initial scaffording for waves-intro sim, see phetsims/wave-interferen…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 30, 2019
1 parent 8e4325d commit ad964d6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 4 additions & 1 deletion js/waves-intro-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ require.config( {
AXON: '../../axon/js',
BRAND: '../../brand/' + phet.chipper.brand + '/js',
DOT: '../../dot/js',
GRIDDLE: '../../griddle/js',
JOIST: '../../joist/js',
KITE: '../../kite/js',
PHETCOMMON: '../../phetcommon/js',
Expand All @@ -40,7 +41,9 @@ require.config( {
SUN: '../../sun/js',
TAMBO: '../../tambo/js',
TANDEM: '../../tandem/js',
WAVES_INTRO: '.'
TWIXT: '../../twixt/js',
WAVES_INTRO: '.',
WAVE_INTERFERENCE: '../../wave-interference/js'
},

// optional cache buster to make browser refresh load all included scripts, can be disabled with ?cacheBuster=false
Expand Down
19 changes: 17 additions & 2 deletions js/waves-intro-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ define( require => {
'use strict';

// modules
const AlignGroup = require( 'SCENERY/nodes/AlignGroup' );
const MediumScreen = require( 'WAVE_INTERFERENCE/medium/MediumScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const WavesIntroScreen = require( 'WAVES_INTRO/waves-intro/WavesIntroScreen' );

// strings
const wavesIntroTitleString = require( 'string!WAVES_INTRO/waves-intro.title' );
Expand All @@ -32,7 +33,21 @@ define( require => {
// launch the sim - beware that scenery Image nodes created outside of SimLauncher.launch() will have zero bounds
// until the images are fully loaded, see https://github.com/phetsims/coulombs-law/issues/70
SimLauncher.launch( () => {
const sim = new Sim( wavesIntroTitleString, [ new WavesIntroScreen() ], simOptions );

// Panels on the right side of the lattice (in the first three screens) have matching widths, within each screen and
// across screens.
const alignGroup = new AlignGroup( {

// Elements should have the same widths but not constrained to have the same heights
matchVertical: false
} );

const screens = [
new MediumScreen( 'waterScene', 'Water', alignGroup ),
new MediumScreen( 'soundScene', 'Sound', alignGroup ),
new MediumScreen( 'lightScene', 'Light', alignGroup )
];
const sim = new Sim( wavesIntroTitleString, screens, simOptions );
sim.start();
} );
} );
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"phet",
"adapted-from-phet"
],
"phetLibs": [
"wave-interference",
"twixt",
"griddle"
],
"simulation": true
},
"eslintConfig": {
Expand Down

0 comments on commit ad964d6

Please sign in to comment.