Skip to content

Commit

Permalink
Add documentation - see phetsims/center-and-variability#328
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-blackman committed Jul 11, 2023
1 parent 3811bc3 commit ddf2748
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/soccer-common/model/SoccerSceneModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ export default class SoccerSceneModel<T extends SoccerBall = SoccerBall> extends

Multilink.multilink( [ this.activeKickerIndexProperty, this.maxKicksProperty ], ( activeKickerIndex, maxKicks ) => {
this.soccerPlayers.forEach( ( soccerPlayer, index ) => {

// If activeKickerIndex is greater than the number of kickers, but we want showing the last kicker, show the last available player
const showAsLastKicker = showPlayersWhenDoneKicking && ( activeKickerIndex === this.maxKicksLimit && index === activeKickerIndex - 1 );
soccerPlayer.soccerPlayerPhaseProperty.value = ( ( index === activeKickerIndex && ( index < maxKicks || showPlayersWhenDoneKicking ) ) || showAsLastKicker ) ? SoccerPlayerPhase.READY : SoccerPlayerPhase.INACTIVE;
} );
Expand Down

0 comments on commit ddf2748

Please sign in to comment.