Skip to content

Commit

Permalink
Using new GameAudioPlayer in area-model, see phetsims/vegas#77
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jun 4, 2019
1 parent d9080bf commit de877a5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
5 changes: 0 additions & 5 deletions js/game/model/GameAreaModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define( function( require ) {
// modules
var AreaLevel = require( 'AREA_MODEL_COMMON/game/model/AreaLevel' );
var areaModelCommon = require( 'AREA_MODEL_COMMON/areaModelCommon' );
var BooleanProperty = require( 'AXON/BooleanProperty' );
var DynamicProperty = require( 'AXON/DynamicProperty' );
var Entry = require( 'AREA_MODEL_COMMON/game/model/Entry' );
var EntryStatus = require( 'AREA_MODEL_COMMON/game/model/EntryStatus' );
Expand All @@ -34,9 +33,6 @@ define( function( require ) {
// @public {boolean}
this.hasExponents = hasExponents;

// @public {BooleanProperty} - Whether sounds will occur on completion of game actions.
this.soundEnabledProperty = new BooleanProperty( true );

// @public {Property.<AreaLevel|null>} - The current level
this.currentLevelProperty = new Property( null, {
isValidValue: function( value ) {
Expand Down Expand Up @@ -176,7 +172,6 @@ define( function( require ) {
*/
reset: function() {
this.activeEntryProperty.reset();
this.soundEnabledProperty.reset();
this.currentLevelProperty.reset();
this.levels.forEach( function( level ) {
level.reset();
Expand Down
9 changes: 0 additions & 9 deletions js/game/view/GameAreaScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ define( function( require ) {
var ScoreDisplayLabeledStars = require( 'VEGAS/ScoreDisplayLabeledStars' );
var ScoreDisplayStars = require( 'VEGAS/ScoreDisplayStars' );
var ScreenView = require( 'JOIST/ScreenView' );
var SoundToggleButton = require( 'SCENERY_PHET/buttons/SoundToggleButton' );
var StarNode = require( 'SCENERY_PHET/StarNode' );
var Term = require( 'AREA_MODEL_COMMON/common/model/Term' );
var Text = require( 'SCENERY/nodes/Text' );
Expand Down Expand Up @@ -235,14 +234,6 @@ define( function( require ) {
}
} );

// "Spimd tpgg;e" was apparently what I typed. "Sound toggle" is probably more accurate.
this.levelSelectionLayer.addChild( new SoundToggleButton( model.soundEnabledProperty, {
touchAreaXDilation: 10,
touchAreaYDilation: 10,
x: 20,
bottom: this.layoutBounds.height - 20
} ) );

// Reset All button
var resetAllButton = new ResetAllButton( {
listener: function() {
Expand Down
4 changes: 2 additions & 2 deletions js/game/view/GameAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define( function( require ) {
// modules
var areaModelCommon = require( 'AREA_MODEL_COMMON/areaModelCommon' );
var AreaModelCommonConstants = require( 'AREA_MODEL_COMMON/common/AreaModelCommonConstants' );
var GameAudioPlayerOld = require( 'VEGAS/GameAudioPlayerOld' );
var GameAudioPlayer = require( 'VEGAS/GameAudioPlayer' );
var GameState = require( 'AREA_MODEL_COMMON/game/model/GameState' );
var inherit = require( 'PHET_CORE/inherit' );

Expand All @@ -22,7 +22,7 @@ define( function( require ) {
* @param {GameAreaModel} model
*/
function GameAudio( model ) {
var audioPlayer = new GameAudioPlayerOld( model.soundEnabledProperty );
var audioPlayer = new GameAudioPlayer();

model.stateProperty.link( function( state, oldState ) {
// If we just moved to/from level section (outside of a level), don't fire sounds.
Expand Down

0 comments on commit de877a5

Please sign in to comment.