Skip to content

Commit

Permalink
Game review see #88
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed May 25, 2017
1 parent 37aaa4a commit 40110a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/game/model/EEGameModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define( function( require ) {
// properties
//------------------------------------------------------------------------

// @public
// @public {Property.<boolean>}
this.soundEnabledProperty = new Property( true );
this.timerEnabledProperty = new Property( true );
this.allLevelsCompletedProperty = new Property( false );
Expand All @@ -51,7 +51,8 @@ define( function( require ) {
// shuffle the challenge descriptors before creating the levels
EEChallengeDescriptors.shuffleChallenges();

// @public (read-only) - models for each of the game levels REVIEW: gameLevels is a better name?
// @public {Array.<EEGameLevelModel>} (read-only) - models for each of the game levels REVIEW: gameLevels is a
// better name?
this.gameLevelModels = [];
_.times( NUMBER_OF_LEVELS, function( level ) {
self.gameLevelModels.push( new EEGameLevelModel(
Expand All @@ -62,6 +63,7 @@ define( function( require ) {
} );

// function to total up the score and update the property that tracks whether all levels are completed
//REVIEW: only one usage in a lazyLink. Inline?
function updateAllLevelsCompleted() {
var totalScore = 0;
self.gameLevelModels.forEach( function( gameLevelModel ) {
Expand All @@ -77,6 +79,8 @@ define( function( require ) {
} );

// @public - score properties for each level
//REVIEW: visibility, type?
//REVIEW: Why is this necessary? Just access the gameLevelModels?
this.levelScoreProperties = []; // @public, read only
_.times( NUMBER_OF_LEVELS, function( index ) {
self.levelScoreProperties.push( self.gameLevelModels[ index ].scoreProperty );
Expand All @@ -87,6 +91,7 @@ define( function( require ) {

return inherit( Object, EEGameModel, {

//REVIEW: doc
step: function( dt ) {

// step the currently active level model (if there is one)
Expand All @@ -96,6 +101,7 @@ define( function( require ) {
},

// @public
//REVIEW: doc, any why is this necessary? currentLevelProperty is public.
selectLevel: function( levelNumber ) {
this.currentLevelProperty.set( levelNumber );
},
Expand Down

0 comments on commit 40110a9

Please sign in to comment.