From 47cd3fe6e07a9354a28ad94c931b87de3473e632 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Fri, 6 Jul 2018 11:56:44 -0600 Subject: [PATCH] use 1-based level numbering in FiniteStatusBar, https://github.com/phetsims/vegas/issues/75, https://github.com/phetsims/balancing-chemical-equations/issues/127 Signed-off-by: Chris Malley --- js/game/view/GamePlayNode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/game/view/GamePlayNode.js b/js/game/view/GamePlayNode.js index 07f76fa0..527989ad 100644 --- a/js/game/view/GamePlayNode.js +++ b/js/game/view/GamePlayNode.js @@ -13,6 +13,7 @@ define( function( require ) { var BCEConstants = require( 'BALANCING_CHEMICAL_EQUATIONS/common/BCEConstants' ); var BCEQueryParameters = require( 'BALANCING_CHEMICAL_EQUATIONS/common/BCEQueryParameters' ); var BoxesNode = require( 'BALANCING_CHEMICAL_EQUATIONS/common/view/BoxesNode' ); + var DerivedProperty = require( 'AXON/DerivedProperty' ); var Dimension2 = require( 'DOT/Dimension2' ); var EquationNode = require( 'BALANCING_CHEMICAL_EQUATIONS/common/view/EquationNode' ); var FiniteStatusBar = require( 'VEGAS/FiniteStatusBar' ); @@ -56,7 +57,9 @@ define( function( require ) { // status bar var statusBar = new FiniteStatusBar( layoutBounds, visibleBoundsProperty, model.pointsProperty, { scoreDisplayConstructor: ScoreDisplayLabeledNumber, - levelProperty: model.levelProperty, + + // FiniteStatusBar uses 1-based level numbering, model is 0-based, see #127. + levelProperty: new DerivedProperty( [ model.levelProperty ], function( level ) { return level + 1; } ), challengeIndexProperty: model.currentEquationIndexProperty, numberOfChallengesProperty: model.numberOfEquationsProperty, elapsedTimeProperty: model.timer.elapsedTimeProperty,