Closed pixelzoom closed 6 years ago
In case you were planning to dive right into this... Please hold off for a couple of hours, I'm making an API change.
API changes completed. Status bars and LevelSelectionButton are now responsible for creating and managing their own score display. Feel free to proceed.
new Rectangle( 0, 0, 1, 1 {
can be simplified to new Rectangle( {
, unless we are really using the 1x1 dimensions.Agreed, barHeight
would be better as an option.
Fine with changing to new Rectangle( {
. I tend to stick with new Rectangle(x,y,w,h,{
instead of using the pseudo-polymorphic constructors.
Agreed, barHeight would be better as an option.
Btw... Note that barHeight
is computed by the subtypes based on the UI components in the bar. If you want the client to be able to set (or use a default) barHeight
, that's going to be a bunch of work.
About this on Slack, @jonathanolson said:
Ahh, never mind. I just don't want clients all specifying different heights.
layout( leftEdge, rightEdge, centerY )
, or something else that deduplicates options.dynamicAligment (which looks the same between the two)?What if subtypes had to implement an abstract
layout(
...
I think that's worth doing.
InfiniteStatusBar handles the scoreDisplay resizing, but FiniteStatusBar doesn't handle that. I
Probably an oversight, I'll make it so.
if ( self.bar.hasListener( 'bounds', updateLayout ) ) {
self.bar.off( 'bounds', updateLayout );
}
I don't see references for this.bar
(at least initially). Is there something I'm missing?
I don't see references for
this.bar
...
Typo, should ben this.barNode
.
startOverButton
? (The back button is being disposed on the infinite one).Does FiniteStatusBar need a disposal of startOverButton? (The back button is being disposed on the infinite one).
Since the buttons are owned by the status bars, and not visible as part of the public API, neither button probably needs to be disposed.
lineWidth: 1
in LevelSelectionButton can be removed, as it is the default.{ fill: null }
is not needed in LevelSelectionButton's createSizedImageNode (can just omit the options argument).ScoreDisplayLabeledStars:
From slack:
Jonathan Olson [10:03 AM] Understood. Looks like I'll be able to integrate bar usage in area-model now?
Chris Malley [10:03 AM] that might be a good thing to attempt as part of code review.
I'll plan to integrate into area-model (and make-a-ten?) as part of the review then. Main pass through the code complete.
All issues that @jonathanolson identified (see above check box items) have been addressed. @jonathanolson do you want to take a peek? If all looks OK, feel free to close.
Looks good. I'll be integrating things today.
Significant modifications and new code were involved in #59 and #66. This issue is to review that work.
Components to be reviewed:
StatusBar
- base type for status bar that appears at top of gamesFiniteStatusBar
- status bar for games with a finite number of challenges, replacesScoreboardBar
InfiniteStatusBar
- new status bar for games with an open-ended (infinite) number of challengesRewardDialog
- dialog that appear when the user reaches some score in an open-ended gameLevelSelectionButton
- enhances and replacesLevelSelectionItemNode
ScoreDisplay*
- 4 types that implement different ways of presenting the score, used in all of the aboveThe vegas demo was also heavily modified.
High priority, since there's an immediate need for this is games that being developed now (Equality Explorer, Area Model, Fractions, ...)
Assigning to @jonathanolson. If you don't have time, please consult with @ariel-phet. Link any related issues that you create to this issue.