Skip to content

Commit

Permalink
added sound for balloon hitting wall, see #484
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Feb 22, 2021
1 parent eab8567 commit 00fe347
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
14 changes: 13 additions & 1 deletion js/balloons-and-static-electricity/view/BalloonNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ import SoundClip from '../../../../tambo/js/sound-generators/SoundClip.js';
import soundManager from '../../../../tambo/js/soundManager.js';
import Utterance from '../../../../utterance-queue/js/Utterance.js';
import grabBalloonSound from '../../../sounds/balloon-grab-004_mp3.js';
import releaseBalloonSound from '../../../sounds/balloon-release-004_mp3.js';
import balloonHitsSweaterSound from '../../../sounds/balloon-hit-sweater_mp3.js';
import releaseBalloonSound from '../../../sounds/balloon-release-004_mp3.js';
import balloonHitsWallSound from '../../../sounds/wall-contact_mp3.js';
import balloonsAndStaticElectricity from '../../balloonsAndStaticElectricity.js';
import BASEA11yStrings from '../BASEA11yStrings.js';
import BASEQueryParameters from '../BASEQueryParameters.js';
Expand Down Expand Up @@ -231,6 +232,17 @@ class BalloonNode extends Node {
}
} );

// sound generation for when the balloon hits the wall
const balloonHitsWallSoundClip = new SoundClip( balloonHitsWallSound, {
initialOutputLevel: 0.2
} );
soundManager.addSoundGenerator( balloonHitsWallSoundClip );
model.touchingWallProperty.link( touchingWall => {
if ( touchingWall ) {
balloonHitsWallSoundClip.play();
}
} );

// pdom
balloonImageNode.focusHighlight = new FocusHighlightFromNode( balloonImageNode );

Expand Down
8 changes: 8 additions & 0 deletions sounds/license.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Ashton Morris (PhET Interactive Simulations)"
},
"wall-contact.mp3": {
"text": [
"Copyright 2002-2020 University of Colorado Boulder"
],
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Mike Winters for use by PhET"
}
}
Binary file added sounds/wall-contact.mp3
Binary file not shown.
21 changes: 21 additions & 0 deletions sounds/wall-contact_mp3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00fe347

Please sign in to comment.