diff --git a/images/compare_screen_placeholder.png b/images/compare_screen_placeholder.png index 44b86842..87d64586 100644 Binary files a/images/compare_screen_placeholder.png and b/images/compare_screen_placeholder.png differ diff --git a/images/game_screen_icon.png b/images/game_screen_icon.png new file mode 100644 index 00000000..561b3cd2 Binary files /dev/null and b/images/game_screen_icon.png differ diff --git a/images/game_screen_placeholder.png b/images/game_screen_placeholder.png new file mode 100644 index 00000000..04373788 Binary files /dev/null and b/images/game_screen_placeholder.png differ diff --git a/images/lab_screen_placeholder.png b/images/lab_screen_placeholder.png index fd86b065..b035c186 100644 Binary files a/images/lab_screen_placeholder.png and b/images/lab_screen_placeholder.png differ diff --git a/js/game/GameScreen.js b/js/game/GameScreen.js new file mode 100644 index 00000000..084fd2bd --- /dev/null +++ b/js/game/GameScreen.js @@ -0,0 +1,48 @@ +// Copyright 2019, University of Colorado Boulder + +/** + * The 'Game' screen. + * + * @author Chris Klusendorf (PhET Interactive Simulations) + */ +define( require => { + 'use strict'; + + // modules + const GameModel = require( 'NUMBER_PLAY/game/model/GameModel' ); + const GameScreenView = require( 'NUMBER_PLAY/game/view/GameScreenView' ); + const Image = require( 'SCENERY/nodes/Image' ); + const numberPlay = require( 'NUMBER_PLAY/numberPlay' ); + const Property = require( 'AXON/Property' ); + const Screen = require( 'JOIST/Screen' ); + + // strings + const screenGameString = require( 'string!NUMBER_PLAY/screen.game' ); + + // images + const gameScreenIconImage = require( 'image!NUMBER_PLAY/game_screen_icon.png' ); + + class GameScreen extends Screen { + + /** + * @param {Tandem} tandem + */ + constructor( tandem ) { + + const options = { + name: screenGameString, + backgroundColorProperty: new Property( 'white' ), + homeScreenIcon: new Image( gameScreenIconImage ), + tandem: tandem + }; + + super( + () => new GameModel( tandem.createTandem( 'model' ) ), + model => new GameScreenView( model, tandem.createTandem( 'view' ) ), + options + ); + } + } + + return numberPlay.register( 'GameScreen', GameScreen ); +} ); \ No newline at end of file diff --git a/js/game/model/GameModel.js b/js/game/model/GameModel.js new file mode 100644 index 00000000..ffee9da3 --- /dev/null +++ b/js/game/model/GameModel.js @@ -0,0 +1,42 @@ +// Copyright 2019, University of Colorado Boulder + +/** + * Model class for the 'Game' screen. + * + * @author Chris Klusendorf (PhET Interactive Simulations) + */ +define( require => { + 'use strict'; + + // modules + const numberPlay = require( 'NUMBER_PLAY/numberPlay' ); + + class GameModel { + + /** + * @param {Tandem} tandem + */ + constructor( tandem ) { + //TODO + } + + /** + * Resets the model. + * @public + */ + reset() { + //TODO + } + + /** + * Steps the model. + * @param {number} dt - time step, in seconds + * @public + */ + step( dt ) { + //TODO + } + } + + return numberPlay.register( 'GameModel', GameModel ); +} ); \ No newline at end of file diff --git a/js/game/view/GameScreenView.js b/js/game/view/GameScreenView.js new file mode 100644 index 00000000..6d2b0e78 --- /dev/null +++ b/js/game/view/GameScreenView.js @@ -0,0 +1,51 @@ +// Copyright 2019, University of Colorado Boulder + +/** + * ScreenView for the 'Game' screen. + * + * @author Chris Klusendorf (PhET Interactive Simulations) + */ +define( require => { + 'use strict'; + + // modules + const Image = require( 'SCENERY/nodes/Image' ); + const numberPlay = require( 'NUMBER_PLAY/numberPlay' ); + const ScreenView = require( 'JOIST/ScreenView' ); + + // images + const gameScreenPlaceholderImage = require( 'image!NUMBER_PLAY/game_screen_placeholder.png' ); + + class GameScreenView extends ScreenView { + + /** + * @param {GameModel} model + * @param {Tandem} tandem + */ + constructor( model, tandem ) { + + super( { + tandem: tandem + } ); + + // add the screen's placeholder image + const gameScreenPlaceholderImageNode = new Image( gameScreenPlaceholderImage, { + maxWidth: this.layoutBounds.width, + maxHeight: this.layoutBounds.height, + cursor: 'pointer' + } ); + gameScreenPlaceholderImageNode.center = this.layoutBounds.center; + this.addChild( gameScreenPlaceholderImageNode ); + } + + /** + * Resets the view. + * @public + */ + reset() { + //TODO + } + } + + return numberPlay.register( 'GameScreenView', GameScreenView ); +} ); \ No newline at end of file diff --git a/js/number-play-main.js b/js/number-play-main.js index 3527a5f5..df603fef 100644 --- a/js/number-play-main.js +++ b/js/number-play-main.js @@ -10,6 +10,7 @@ define( require => { // modules const CompareScreen = require( 'NUMBER_PLAY/compare/CompareScreen' ); + const GameScreen = require( 'NUMBER_PLAY/game/GameScreen' ); const LabScreen = require( 'NUMBER_PLAY/lab/LabScreen' ); const Sim = require( 'JOIST/Sim' ); const SimLauncher = require( 'JOIST/SimLauncher' ); @@ -40,6 +41,7 @@ define( require => { new TenScreen( Tandem.rootTandem.createTandem( 'tenScreen' ) ), new TwentyScreen( Tandem.rootTandem.createTandem( 'twentyScreen' ) ), new CompareScreen( Tandem.rootTandem.createTandem( 'compareScreen' ) ), + new GameScreen( Tandem.rootTandem.createTandem( 'gameScreen' ) ), new LabScreen( Tandem.rootTandem.createTandem( 'labScreen' ) ) ], simOptions ); sim.start(); diff --git a/number-play-strings_en.json b/number-play-strings_en.json index d03dc863..a29eff87 100644 --- a/number-play-strings_en.json +++ b/number-play-strings_en.json @@ -11,6 +11,9 @@ "screen.compare": { "value": "Compare" }, + "screen.game": { + "value": "Game" + }, "screen.lab": { "value": "Lab" },