From 4c42f303b4741d6f93f8ab135ecda0ecaf571206 Mon Sep 17 00:00:00 2001 From: Marla Schulz Date: Mon, 1 Apr 2024 15:26:34 -0600 Subject: [PATCH] Add soccer ball value sounds, see: https://github.com/phetsims/mean-share-and-balance/issues/144 --- js/balance-point/model/BalancePointSceneModel.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/balance-point/model/BalancePointSceneModel.ts b/js/balance-point/model/BalancePointSceneModel.ts index f9ea1e89..0ff9a538 100644 --- a/js/balance-point/model/BalancePointSceneModel.ts +++ b/js/balance-point/model/BalancePointSceneModel.ts @@ -22,6 +22,7 @@ import NumberProperty from '../../../../axon/js/NumberProperty.js'; import DerivedProperty from '../../../../axon/js/DerivedProperty.js'; import Multilink from '../../../../axon/js/Multilink.js'; import Utils from '../../../../dot/js/Utils.js'; +import NumberTone from '../../../../soccer-common/js/model/NumberTone.js'; type BalancePointSceneModelOptions = SoccerSceneModelOptions; @@ -159,6 +160,12 @@ export default class BalancePointSceneModel extends SoccerSceneModel { } } ); + + this.soccerBalls.forEach( soccerBall => { + soccerBall.toneEmitter.addListener( value => { + NumberTone.playValue( value ); + } ); + } ); } private getKickedBalls(): SoccerBall[] {