Skip to content

Commit

Permalink
docs related to review, see #105
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Apr 20, 2022
1 parent 4577c94 commit 24bcf8c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions js/AllLevelsCompletedNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default class AllLevelsCompletedNode extends Node {
super();

const options = optionize<AllLevelsCompletedNodeOptions, SelfOptions, NodeOptions>()( {

// SelfOptions
faceDiameter: 160,
maxTextWidth: 300
}, providedOptions );
Expand Down
2 changes: 1 addition & 1 deletion js/ElapsedTimeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class ElapsedTimeNode extends HBox {

super( options );

// Update the time display
// Update the time display.
const elapsedTimeListener = ( elapsedTime: number ) => {
timeValue.text = GameTimer.formatTime( elapsedTime );
};
Expand Down
3 changes: 2 additions & 1 deletion js/FiniteStatusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Bounds2 from '../../dot/js/Bounds2.js';

// Valid values for scoreDisplayConstructor. These are the types that are relevant for this status bar.
// All constructors must have the same signature!
// REVIEW-TS: Would it be possible to type this and thus enforce the requirement for having the same signature?
const VALID_SCORE_DISPLAY_CONSTRUCTORS = [
ScoreDisplayLabeledNumber, ScoreDisplayLabeledStars
];
Expand Down Expand Up @@ -54,7 +55,7 @@ type SelfOptions = {
startOverButtonOptions?: TextPushButtonOptions | null;
startOverButtonText?: string;

// Timer
// options for the timer node
clockIconRadius?: number;

// spacing and margin for things in the bar
Expand Down
1 change: 1 addition & 0 deletions js/InfiniteStatusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { PushButtonListener } from '../../sun/js/buttons/PushButtonModel.js';

// Valid values for scoreDisplayConstructor. These are the types that are relevant for this status bar.
// All constructors must have the same signature!
// REVIEW-TS: Would it be possible to type this and thus enforce the requirement for having the same signature?
const VALID_SCORE_DISPLAY_CONSTRUCTORS = [
ScoreDisplayLabeledNumber, ScoreDisplayNumberAndStar
];
Expand Down
1 change: 1 addition & 0 deletions js/LevelSelectionButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import vegas from './vegas.js';
// constants
const DEFAULT_BEST_TIME_FONT = new PhetFont( 24 );
const SCALING_TOLERANCE = 1E-4; // Empirically chosen as something the human eye is unlikely to notice.
// REVIEW-TS: Would it be possible to type this and thus enforce the requirement for having the same signature?
const VALID_SCORE_DISPLAY_CONSTRUCTORS = [

// All constructors must have the same signature!
Expand Down
2 changes: 1 addition & 1 deletion js/RewardNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import vegas from './vegas.js';
const DEBUG_CANVAS_NODE_BOUNDS = false; // shows a gray rectangle for the CanvasNode to help ensure that its bounds are accurate
const MAX_SPEED = 200; // The maximum speed an image can fall in screen pixels per second.

// Data structure to hold a cached HTMLImageElement and its associated properties
// Data structure to hold a cached HTMLImageElement and its associated properties.
type CachedImage = {

// The image to be rendered in the canvas, to be filled in by toImage callback.
Expand Down
2 changes: 2 additions & 0 deletions js/ScoreDisplayLabeledNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export default class ScoreDisplayLabeledNumber extends Node {
constructor( scoreProperty: IProperty<number>, providedOptions?: ScoreDisplayLabeledNumberOptions ) {

const options = optionize<ScoreDisplayLabeledNumberOptions, SelfOptions, HBoxOptions>()( {

// SelfOptions
font: StatusBar.DEFAULT_FONT,
textFill: 'black',
scoreDecimalPlaces: 0
Expand Down
2 changes: 2 additions & 0 deletions js/ScoreDisplayLabeledStars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export default class ScoreDisplayLabeledStars extends HBox {
constructor( scoreProperty: IProperty<number>, providedOptions?: ScoreDisplayLabeledStarsOptions ) {

const options = optionize<ScoreDisplayLabeledStarsOptions, SelfOptions, HBoxOptions>()( {

// SelfOptions
font: StatusBar.DEFAULT_FONT,
textFill: 'black',
spacing: 5
Expand Down

0 comments on commit 24bcf8c

Please sign in to comment.