Skip to content

Commit

Permalink
instrument screens #38
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
  • Loading branch information
pixelzoom committed Jun 7, 2018
1 parent e1946fb commit b97ece7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions js/energy/EnergyScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ define( function( require ) {
var energyString = require( 'string!HOOKES_LAW/energy' );

/**
* @param {Object} [options]
* @constructor
*/
function EnergyScreen() {
function EnergyScreen( options ) {

var options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
name: energyString,
homeScreenIcon: HookesLawIconFactory.createEnergyScreenIcon()
} );
}, options );

Screen.call( this,
function() { return new EnergyModel(); },
Expand Down
7 changes: 4 additions & 3 deletions js/hookes-law-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define( function( require ) {
var Sim = require( 'JOIST/Sim' );
var SimLauncher = require( 'JOIST/SimLauncher' );
var SystemsScreen = require( 'HOOKES_LAW/systems/SystemsScreen' );
var Tandem = require( 'TANDEM/Tandem' );

// strings
var hookesLawTitleString = require( 'string!HOOKES_LAW/hookes-law.title' );
Expand All @@ -30,9 +31,9 @@ define( function( require ) {

SimLauncher.launch( function() {
var screens = [
new IntroScreen(),
new SystemsScreen(),
new EnergyScreen()
new IntroScreen( { tandem: Tandem.rootTandem.createTandem( 'introScreen' ) } ),
new SystemsScreen( { tandem: Tandem.rootTandem.createTandem( 'systemsScreen' ) } ),
new EnergyScreen( { tandem: Tandem.rootTandem.createTandem( 'energyScreen' ) } )
];
var sim = new Sim( hookesLawTitleString, screens, options );
sim.start();
Expand Down
7 changes: 4 additions & 3 deletions js/intro/IntroScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ define( function( require ) {
var introString = require( 'string!HOOKES_LAW/intro' );

/**
* @param {Object} [options]
* @constructor
*/
function IntroScreen() {
function IntroScreen( options ) {

var options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
name: introString,
homeScreenIcon: HookesLawIconFactory.createIntroScreenIcon()
} );
}, options );

Screen.call( this,
function() { return new IntroModel(); },
Expand Down
7 changes: 4 additions & 3 deletions js/systems/SystemsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ define( function( require ) {
var systemsString = require( 'string!HOOKES_LAW/systems' );

/**
* @param {Object} [options]
* @constructor
*/
function SystemsScreen() {
function SystemsScreen( options ) {

var options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
options = _.extend( {}, HookesLawConstants.SCREEN_OPTIONS, {
name: systemsString,
homeScreenIcon: HookesLawIconFactory.createSystemsScreenIcon()
} );
}, options );

Screen.call( this,
function() { return new SystemsModel(); },
Expand Down

0 comments on commit b97ece7

Please sign in to comment.