diff --git a/js/common/model/BalanceModel.js b/js/common/model/BalanceModel.js index 9fd53179..526146c8 100644 --- a/js/common/model/BalanceModel.js +++ b/js/common/model/BalanceModel.js @@ -8,7 +8,7 @@ */ import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; -import ObservableArray from '../../../../axon/js/ObservableArray.js'; +import createObservableArray from '../../../../axon/js/createObservableArray.js'; import Dimension2 from '../../../../dot/js/Dimension2.js'; import Vector2 from '../../../../dot/js/Vector2.js'; import inherit from '../../../../phet-core/js/inherit.js'; @@ -32,7 +32,7 @@ function BalanceModel( tandem ) { // Model elements self.fulcrum = new Fulcrum( new Dimension2( 1, FULCRUM_HEIGHT ) ); - self.massList = new ObservableArray(); + self.massList = createObservableArray(); self.userControlledMasses = []; // Masses being controlled by user(s), potentially more than one in touch environment. self.columnStateProperty = new EnumerationProperty( ColumnState, ColumnState.DOUBLE_COLUMNS, { diff --git a/js/common/model/Plank.js b/js/common/model/Plank.js index 1ecfe136..10faf1ed 100644 --- a/js/common/model/Plank.js +++ b/js/common/model/Plank.js @@ -8,7 +8,7 @@ import Emitter from '../../../../axon/js/Emitter.js'; import NumberProperty from '../../../../axon/js/NumberProperty.js'; -import ObservableArray from '../../../../axon/js/ObservableArray.js'; +import createObservableArray from '../../../../axon/js/createObservableArray.js'; import Property from '../../../../axon/js/Property.js'; import Matrix3 from '../../../../dot/js/Matrix3.js'; import Vector2 from '../../../../dot/js/Vector2.js'; @@ -57,9 +57,9 @@ function Plank( position, pivotPoint, columnState, userControlledMasses, tandem this.bottomCenterPositionProperty = new Property( position ); // Externally visible observable lists. - self.massesOnSurface = new ObservableArray(); - self.forceVectors = new ObservableArray(); - self.activeDropPositions = new ObservableArray(); // Positions where user-controlled masses would land if dropped, in meters from center. + self.massesOnSurface = createObservableArray(); + self.forceVectors = createObservableArray(); + self.activeDropPositions = createObservableArray(); // Positions where user-controlled masses would land if dropped, in meters from center. // Other external visible attributes. self.pivotPoint = pivotPoint; diff --git a/js/game/model/BalanceGameModel.js b/js/game/model/BalanceGameModel.js index 3af49465..173cd448 100644 --- a/js/game/model/BalanceGameModel.js +++ b/js/game/model/BalanceGameModel.js @@ -10,7 +10,7 @@ */ import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js'; -import ObservableArray from '../../../../axon/js/ObservableArray.js'; +import createObservableArray from '../../../../axon/js/createObservableArray.js'; import Property from '../../../../axon/js/Property.js'; import stepTimer from '../../../../axon/js/stepTimer.js'; import Dimension2 from '../../../../dot/js/Dimension2.js'; @@ -70,10 +70,10 @@ function BalanceGameModel( tandem ) { self.challengeList = null; // Fixed masses that sit on the plank and that the user must attempt to balance. - self.fixedMasses = new ObservableArray(); + self.fixedMasses = createObservableArray(); // Masses that the user moves on to the plank to counterbalance the fixed masses. - self.movableMasses = new ObservableArray(); + self.movableMasses = createObservableArray(); // Masses that the user is (or users are) moving. self.userControlledMasses = [];