Skip to content

Commit

Permalink
Apply WebStorm formatting, see phetsims/phet-info#155
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2021
1 parent 87fa8ec commit eead4e7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion js/balloons-and-static-electricity/model/BalloonModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class BalloonModel {
this.isDraggedProperty.lazyLink( isDragged => {

// When the user starts dragging a balloon, set its non-dragging velocity to zero.
if ( isDragged ){
if ( isDragged ) {
this.velocityProperty.set( Vector2.ZERO );
}

Expand Down
4 changes: 2 additions & 2 deletions js/balloons-and-static-electricity/model/SweaterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class SweaterModel {
this.plusCharges = [];
this.minusCharges = [];

const plusChargesGroupTandem = tandem.createTandem('plusCharges').createGroupTandem( 'plusCharge' );
const minusChargesGroupTandem = tandem.createTandem('minusCharges').createGroupTandem( 'minusCharge' );
const plusChargesGroupTandem = tandem.createTandem( 'plusCharges' ).createGroupTandem( 'plusCharge' );
const minusChargesGroupTandem = tandem.createTandem( 'minusCharges' ).createGroupTandem( 'minusCharge' );
CHARGE_PAIR_POSITIONS.forEach( chargePairPosition => {
const plusCharge = new PointChargeModel(
chargePairPosition.x,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BalloonRubbingSoundGenerator extends NoiseGenerator {
Property.multilink(
[ smoothedSpeedProperty, onSweaterProperty, touchingWallProperty ],
( smoothedDragSpeed, onSweater, touchingWall ) => {
if ( smoothedDragSpeed > 0 && ( onSweater || touchingWall ) ){
if ( smoothedDragSpeed > 0 && ( onSweater || touchingWall ) ) {

// Start the production of the sound if needed.
if ( !this.isPlaying ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,32 @@ class BalloonVelocitySoundGenerator extends SoundClip {
const outputUpdaterMultilink = Property.multilink(
[ balloonVelocityProperty, touchingWallProperty ],
( balloonVelocity, onSweater, touchingWall ) => {
const speed = balloonVelocity.magnitude;
if ( speed > 0 && !touchingWall ) {
if ( !this.isPlaying ) {

// Before starting playback, set the playback rate immediately, otherwise there can be a bit of the "chirp"
// sound.
this.setPlaybackRate( mapSpeedToPlaybackRate( speed, 0 ) );

// Start the sound playing.
this.play();
const speed = balloonVelocity.magnitude;
if ( speed > 0 && !touchingWall ) {
if ( !this.isPlaying ) {

// Before starting playback, set the playback rate immediately, otherwise there can be a bit of the "chirp"
// sound.
this.setPlaybackRate( mapSpeedToPlaybackRate( speed, 0 ) );

// Start the sound playing.
this.play();
}
else {

// Set the playback rate. This will use the nominal time constant, which should lead to a reasonably smooth
// transition of the rate as the velocity changes.
this.setPlaybackRate( mapSpeedToPlaybackRate( speed ) );
}

// Set the output level based on the velocity.
this.setOutputLevel( mapSpeedToOutputLevel( speed, 0.1 ) * options.maxOutputLevel );
}
else{

// Set the playback rate. This will use the nominal time constant, which should lead to a reasonably smooth
// transition of the rate as the velocity changes.
this.setPlaybackRate( mapSpeedToPlaybackRate( speed ) );
else if ( ( speed === 0 || touchingWall ) && this.isPlaying ) {
this.stop();
this.setOutputLevel( 0 );
}

// Set the output level based on the velocity.
this.setOutputLevel( mapSpeedToOutputLevel( speed, 0.1 ) * options.maxOutputLevel );
}
else if ( ( speed === 0 || touchingWall ) && this.isPlaying ) {
this.stop();
this.setOutputLevel( 0 );
}
} );
} );

this.disposeBalloonVelocitySoundGenerator = () => {
outputUpdaterMultilink.dispose();
Expand All @@ -94,7 +94,7 @@ class BalloonVelocitySoundGenerator extends SoundClip {
* release memory references
* @public
*/
dispose(){
dispose() {
this.disposeBalloonVelocitySoundGenerator();
super.dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion js/balloons-and-static-electricity/view/WallNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class WallNode extends Node {
const maxDeflectedXPosition = 739; // empirically determined

_.times( model.wall.numY, index => {
if ( index % 3 === 0 ){
if ( index % 3 === 0 ) {
const xPositionProperty = new DerivedProperty(
[ model.wall.minusCharges[ index ].positionProperty ],
positionVector => positionVector.x
Expand Down

0 comments on commit eead4e7

Please sign in to comment.