-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding screen icons and converting to ES6, see phetsims/fractions-com…
- Loading branch information
1 parent
f6fcb3d
commit 1712dce
Showing
5 changed files
with
79 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,20 @@ | |
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
define( function( require ) { | ||
define( require => { | ||
'use strict'; | ||
|
||
// modules | ||
var Namespace = require( 'PHET_CORE/Namespace' ); | ||
const Namespace = require( 'PHET_CORE/Namespace' ); | ||
|
||
return new Namespace( 'fractionsMixedNumbers' ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
/** | ||
* TODO: doc | ||
* Game screen for Fractions: Mixed Numbers | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
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 ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,37 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
/** | ||
* TODO: doc | ||
* Intro screen for Fractions: Mixed Numbers | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
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 ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
/** | ||
* TODO: doc | ||
* Lab screen for Fractions: Mixed Numbers | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
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 ); | ||
} ); |