-
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
26abc55
commit 7bc94cb
Showing
5 changed files
with
77 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 BuildAFractionScreen = require( 'BUILD_A_FRACTION/view/BuildAFractionScreen' ); | ||
var LabScreen = require( 'BUILD_A_FRACTION/view/LabScreen' ); | ||
var MixedNumbersScreen = require( 'BUILD_A_FRACTION/view/MixedNumbersScreen' ); | ||
var Sim = require( 'JOIST/Sim' ); | ||
var SimLauncher = require( 'JOIST/SimLauncher' ); | ||
const BuildAFractionScreen = require( 'BUILD_A_FRACTION/view/BuildAFractionScreen' ); | ||
const LabScreen = require( 'BUILD_A_FRACTION/view/LabScreen' ); | ||
const MixedNumbersScreen = require( 'BUILD_A_FRACTION/view/MixedNumbersScreen' ); | ||
const Sim = require( 'JOIST/Sim' ); | ||
const SimLauncher = require( 'JOIST/SimLauncher' ); | ||
|
||
// strings | ||
var buildAFractionTitleString = require( 'string!BUILD_A_FRACTION/build-a-fraction.title' ); | ||
const buildAFractionTitleString = require( 'string!BUILD_A_FRACTION/build-a-fraction.title' ); | ||
|
||
var simOptions = { | ||
const simOptions = { | ||
credits: { | ||
//TODO fill in proper credits, all of these fields are optional, see joist.AboutDialog | ||
leadDesign: '', | ||
|
@@ -31,7 +31,7 @@ define( function( require ) { | |
}; | ||
|
||
SimLauncher.launch( function() { | ||
var sim = new Sim( buildAFractionTitleString, [ | ||
const sim = new Sim( buildAFractionTitleString, [ | ||
new BuildAFractionScreen(), | ||
new MixedNumbersScreen(), | ||
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( 'buildAFraction' ); | ||
} ); |
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 | ||
* The non-mixed-numbers game screen for Build a Fraction | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
define( function( require ) { | ||
define( require => { | ||
'use strict'; | ||
|
||
// modules | ||
var buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 inherit = require( 'PHET_CORE/inherit' ); | ||
var Screen = require( 'JOIST/Screen' ); | ||
const buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 Screen = require( 'JOIST/Screen' ); | ||
|
||
// strings | ||
var screenBuildAFractionString = require( 'string!BUILD_A_FRACTION/screen.buildAFraction' ); | ||
|
||
/** | ||
* @constructor | ||
*/ | ||
function BuildAFractionScreen() { | ||
|
||
var options = { | ||
name: screenBuildAFractionString, | ||
backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty | ||
}; | ||
|
||
Screen.call( this, | ||
function() { return new BuildingGameModel( false ); }, | ||
function( model ) { return new BuildingGameScreenView( model ); }, | ||
options | ||
); | ||
const screenBuildAFractionString = require( 'string!BUILD_A_FRACTION/screen.buildAFraction' ); | ||
|
||
class BuildAFractionScreen extends Screen { | ||
constructor() { | ||
super( | ||
() => new BuildingGameModel( false ), | ||
model => new BuildingGameScreenView( model ), | ||
{ | ||
name: screenBuildAFractionString, | ||
backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty, | ||
homeScreenIcon: BuildingGameScreenView.createUnmixedScreenIcon() | ||
} | ||
); | ||
} | ||
} | ||
|
||
buildAFraction.register( 'BuildAFractionScreen', BuildAFractionScreen ); | ||
|
||
return inherit( Screen, BuildAFractionScreen ); | ||
|
||
return buildAFraction.register( 'BuildAFractionScreen', BuildAFractionScreen ); | ||
} ); |
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,35 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
/** | ||
* TODO: doc | ||
* The "Lab" screen for Build a Fraction | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
define( function( require ) { | ||
define( require => { | ||
'use strict'; | ||
|
||
// modules | ||
var buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 inherit = require( 'PHET_CORE/inherit' ); | ||
var Screen = require( 'JOIST/Screen' ); | ||
const buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 Screen = require( 'JOIST/Screen' ); | ||
|
||
// strings | ||
var screenLabString = require( 'string!BUILD_A_FRACTION/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!BUILD_A_FRACTION/screen.lab' ); | ||
|
||
class LabScreen extends Screen { | ||
constructor() { | ||
super( | ||
() => new BuildingLabModel( true ), | ||
model => new BuildingLabScreenView( model ), | ||
{ | ||
name: screenLabString, | ||
backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty | ||
} | ||
); | ||
} | ||
} | ||
|
||
buildAFraction.register( 'LabScreen', LabScreen ); | ||
|
||
return inherit( Screen, LabScreen ); | ||
return buildAFraction.register( 'LabScreen', 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 |
---|---|---|
@@ -1,42 +1,36 @@ | ||
// Copyright 2018, University of Colorado Boulder | ||
|
||
/** | ||
* TODO: doc | ||
* The mixed-numbers game screen for Build a Fraction | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
define( function( require ) { | ||
define( require => { | ||
'use strict'; | ||
|
||
// modules | ||
var buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 inherit = require( 'PHET_CORE/inherit' ); | ||
var Screen = require( 'JOIST/Screen' ); | ||
const buildAFraction = require( 'BUILD_A_FRACTION/buildAFraction' ); | ||
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 Screen = require( 'JOIST/Screen' ); | ||
|
||
// strings | ||
var screenMixedNumbersString = require( 'string!BUILD_A_FRACTION/screen.mixedNumbers' ); | ||
|
||
/** | ||
* @constructor | ||
*/ | ||
function MixedNumbersScreen() { | ||
|
||
var options = { | ||
name: screenMixedNumbersString, | ||
backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty | ||
}; | ||
|
||
Screen.call( this, | ||
function() { return new BuildingGameModel( true ); }, | ||
function( model ) { return new BuildingGameScreenView( model ); }, | ||
options | ||
); | ||
const screenMixedNumbersString = require( 'string!BUILD_A_FRACTION/screen.mixedNumbers' ); | ||
|
||
class MixedNumbersScreen extends Screen { | ||
constructor() { | ||
super( | ||
() => new BuildingGameModel( true ), | ||
model => new BuildingGameScreenView( model ), | ||
{ | ||
name: screenMixedNumbersString, | ||
backgroundColorProperty: FractionsCommonColorProfile.otherScreenBackgroundProperty, | ||
homeScreenIcon: BuildingGameScreenView.createMixedScreenIcon() | ||
} | ||
); | ||
} | ||
} | ||
|
||
buildAFraction.register( 'MixedNumbersScreen', MixedNumbersScreen ); | ||
|
||
return inherit( Screen, MixedNumbersScreen ); | ||
return buildAFraction.register( 'MixedNumbersScreen', MixedNumbersScreen ); | ||
} ); |