diff --git a/js/fractions-mixed-numbers-main.js b/js/fractions-mixed-numbers-main.js index aba8572..e7ea091 100644 --- a/js/fractions-mixed-numbers-main.js +++ b/js/fractions-mixed-numbers-main.js @@ -5,20 +5,20 @@ * * @author Jonathan Olson */ -define( function( require ) { +define( require => { 'use strict'; // modules - var GameScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/GameScreen' ); - var IntroScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/IntroScreen' ); - var LabScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/LabScreen' ); - var Sim = require( 'JOIST/Sim' ); - var SimLauncher = require( 'JOIST/SimLauncher' ); + const GameScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/GameScreen' ); + const IntroScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/IntroScreen' ); + const LabScreen = require( 'FRACTIONS_MIXED_NUMBERS/view/LabScreen' ); + const Sim = require( 'JOIST/Sim' ); + const SimLauncher = require( 'JOIST/SimLauncher' ); // strings - var fractionsMixedNumbersTitleString = require( 'string!FRACTIONS_MIXED_NUMBERS/fractions-mixed-numbers.title' ); + const fractionsMixedNumbersTitleString = require( 'string!FRACTIONS_MIXED_NUMBERS/fractions-mixed-numbers.title' ); - var simOptions = { + const simOptions = { credits: { //TODO fill in proper credits, all of these fields are optional, see joist.AboutDialog leadDesign: '', @@ -30,8 +30,8 @@ define( function( require ) { } }; - SimLauncher.launch( function() { - var sim = new Sim( fractionsMixedNumbersTitleString, [ + SimLauncher.launch( () => { + const sim = new Sim( fractionsMixedNumbersTitleString, [ new IntroScreen(), new GameScreen(), new LabScreen() diff --git a/js/fractionsMixedNumbers.js b/js/fractionsMixedNumbers.js index bddb436..3b967bd 100644 --- a/js/fractionsMixedNumbers.js +++ b/js/fractionsMixedNumbers.js @@ -5,11 +5,11 @@ * * @author Jonathan Olson */ -define( function( require ) { +define( require => { 'use strict'; // modules - var Namespace = require( 'PHET_CORE/Namespace' ); + const Namespace = require( 'PHET_CORE/Namespace' ); return new Namespace( 'fractionsMixedNumbers' ); } ); \ No newline at end of file diff --git a/js/view/GameScreen.js b/js/view/GameScreen.js index e5f83e9..3a8f467 100644 --- a/js/view/GameScreen.js +++ b/js/view/GameScreen.js @@ -1,42 +1,36 @@ // Copyright 2018, University of Colorado Boulder /** - * TODO: doc + * Game screen for Fractions: Mixed Numbers * * @author Jonathan Olson */ -define( function( require ) { +define( require => { 'use strict'; // modules - var BuildingGameModel = require( 'FRACTIONS_COMMON/game/model/BuildingGameModel' ); - var BuildingGameScreenView = require( 'FRACTIONS_COMMON/game/view/BuildingGameScreenView' ); - var FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); - var fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); - var inherit = require( 'PHET_CORE/inherit' ); - var Screen = require( 'JOIST/Screen' ); + const BuildingGameModel = require( 'FRACTIONS_COMMON/game/model/BuildingGameModel' ); + const BuildingGameScreenView = require( 'FRACTIONS_COMMON/game/view/BuildingGameScreenView' ); + const FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); + const fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); + const Screen = require( 'JOIST/Screen' ); // strings - var screenGameString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.game' ); - - /** - * @constructor - */ - function GameScreen() { - - var options = { - name: screenGameString, - backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty - }; - - Screen.call( this, - function() { return new BuildingGameModel( true ); }, - function( model ) { return new BuildingGameScreenView( model ); }, - options - ); + const screenGameString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.game' ); + + class GameScreen extends Screen { + constructor() { + super( + () => new BuildingGameModel( true ), + model => new BuildingGameScreenView( model ), + { + name: screenGameString, + backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty, + homeScreenIcon: BuildingGameScreenView.createMixedScreenIcon() + } + ); + } } - fractionsMixedNumbers.register( 'GameScreen', GameScreen ); - - return inherit( Screen, GameScreen ); + return fractionsMixedNumbers.register( 'GameScreen', GameScreen ); } ); diff --git a/js/view/IntroScreen.js b/js/view/IntroScreen.js index 5103a99..b261e5e 100644 --- a/js/view/IntroScreen.js +++ b/js/view/IntroScreen.js @@ -1,42 +1,37 @@ // Copyright 2018, University of Colorado Boulder /** - * TODO: doc + * Intro screen for Fractions: Mixed Numbers * * @author Jonathan Olson */ -define( function( require ) { +define( require => { 'use strict'; // modules - var FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); - var fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); - var inherit = require( 'PHET_CORE/inherit' ); - var IntroModel = require( 'FRACTIONS_COMMON/intro/model/IntroModel' ); - var IntroScreenView = require( 'FRACTIONS_COMMON/intro/view/IntroScreenView' ); - var Screen = require( 'JOIST/Screen' ); + const FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); + const fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); + const IntroModel = require( 'FRACTIONS_COMMON/intro/model/IntroModel' ); + const IntroScreenView = require( 'FRACTIONS_COMMON/intro/view/IntroScreenView' ); + const Screen = require( 'JOIST/Screen' ); // strings - var screenIntroString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.intro' ); - - /** - * @constructor - */ - function IntroScreen() { - - var options = { - name: screenIntroString, - backgroundColorProperty: FractionsCommonColorProfile.introScreenBackgroundProperty - }; - - Screen.call( this, - function() { return new IntroModel( true ); }, - function( model ) { return new IntroScreenView( model ); }, - options - ); + const screenIntroString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.intro' ); + + class IntroScreen extends Screen { + constructor() { + super( + () => new IntroModel( true ), + model => new IntroScreenView( model ), + { + name: screenIntroString, + backgroundColorProperty: FractionsCommonColorProfile.introScreenBackgroundProperty, + homeScreenIcon: IntroScreenView.createMixedScreenIcon(), + navigationBarIcon: IntroScreenView.createMixedScreenThumbnail() + } + ); + } } - fractionsMixedNumbers.register( 'IntroScreen', IntroScreen ); - - return inherit( Screen, IntroScreen ); + return fractionsMixedNumbers.register( 'IntroScreen', IntroScreen ); } ); diff --git a/js/view/LabScreen.js b/js/view/LabScreen.js index 82506ce..b668e18 100644 --- a/js/view/LabScreen.js +++ b/js/view/LabScreen.js @@ -1,42 +1,36 @@ // Copyright 2018, University of Colorado Boulder /** - * TODO: doc + * Lab screen for Fractions: Mixed Numbers * * @author Jonathan Olson */ -define( function( require ) { +define( require => { 'use strict'; // modules - var BuildingLabModel = require( 'FRACTIONS_COMMON/lab/model/BuildingLabModel' ); - var BuildingLabScreenView = require( 'FRACTIONS_COMMON/lab/view/BuildingLabScreenView' ); - var FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); - var fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); - var inherit = require( 'PHET_CORE/inherit' ); - var Screen = require( 'JOIST/Screen' ); + const BuildingLabModel = require( 'FRACTIONS_COMMON/lab/model/BuildingLabModel' ); + const BuildingLabScreenView = require( 'FRACTIONS_COMMON/lab/view/BuildingLabScreenView' ); + const FractionsCommonColorProfile = require( 'FRACTIONS_COMMON/common/view/FractionsCommonColorProfile' ); + const fractionsMixedNumbers = require( 'FRACTIONS_MIXED_NUMBERS/fractionsMixedNumbers' ); + const Screen = require( 'JOIST/Screen' ); // strings - var screenLabString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.lab' ); - - /** - * @constructor - */ - function LabScreen() { - - var options = { - name: screenLabString, - backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty - }; - - Screen.call( this, - function() { return new BuildingLabModel( true ); }, - function( model ) { return new BuildingLabScreenView( model ); }, - options - ); + const screenLabString = require( 'string!FRACTIONS_MIXED_NUMBERS/screen.lab' ); + + class LabScreen extends Screen { + constructor() { + super( + () => new BuildingLabModel( true ), + model => new BuildingLabScreenView( model ), + { + name: screenLabString, + backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty, + homeScreenIcon: BuildingLabScreenView.createMixedScreenIcon() + } + ); + } } - fractionsMixedNumbers.register( 'LabScreen', LabScreen ); - - return inherit( Screen, LabScreen ); + return fractionsMixedNumbers.register( 'LabScreen', LabScreen ); } );