Skip to content

Commit

Permalink
added combiplyer
Browse files Browse the repository at this point in the history
  • Loading branch information
arneson committed Nov 23, 2014
1 parent ce31d8a commit dac4ca7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/controllers/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope
$scope.timeLeft = 15;
$scope.score.total = 0;
$scope.markerSet = false;
$scope.combiplyer = 0;
$scope.comboplyer = 1;

// this is the first song the user guesses
firstSong = fetchNewSong();
Expand Down Expand Up @@ -164,6 +164,8 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope
if ($scope.currentYear >= $scope.timelineSongs[ans-1].year &&
$scope.currentYear <= $scope.timelineSongs[ans].year)
answerSuccess();
else
$scope.comboplyer = 1;
}

//clear the selection
Expand All @@ -178,8 +180,8 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope

function answerSuccess() {
addSongToTimeline($scope.currentSong);
$scope.score.total += $scope.score.round;
$scope.combiplyer++;
$scope.score.total += ($scope.score.round * $scope.comboplyer);
$scope.comboplyer++;
}

}]);
Expand Down
2 changes: 1 addition & 1 deletion app/partials/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ <h2 id="question">Which timespan?</h2>
<div id="endpoint">NOW</div>
</div>

<div id="game-footer"><h2 id="score">SCORE <em>{{score.total}}</em><em class="emergency">{{score.round!=0 && ' +' + score.round || ''}}</em></h2><h2 id="round">CORRECT GUESSES {{timelineSongs.length}} / 10</h2></div>
<div id="game-footer"><h2 id="score">SCORE <em>{{score.total}}</em><em class="emergency">{{(score.round!=0 && ' + ' + score.round + (' x ' + comboplyer)|| '')}}</em></h2><h2 id="round">CORRECT GUESSES {{timelineSongs.length}} / 10</h2></div>

0 comments on commit dac4ca7

Please sign in to comment.