MAPG-54 introduce round info - current round number and score

This commit is contained in:
bence committed 2020-05-23 01:25:43 +02:00
1 parent b7679254c7
commit e8492994dd
3 files changed
+44 -6

No files matched your search

+12 -1
View File
@@ -33,8 +33,13 @@
if (Core.rounds.length > 0 && !Core.rounds[Core.rounds.length - 1].guessPosition) {
Core.realPosition = Core.rounds[Core.rounds.length - 1].realPosition;
Core.loadPositionInfo(Core.realPosition);
document.getElementById('currentRound').innerHTML = String(Core.rounds.length) + '/' + String(Core.NUMBER_OF_ROUNDS);
document.getElementById('currentScoreSum').innerHTML = String(Core.scoreSum) + '/' + String((Core.rounds.length-1) * Core.MAX_SCORE);
} else {
Core.startNewRound();
document.getElementById('currentScoreSum').innerHTML = String(0);
}
},
@@ -60,6 +65,8 @@
document.getElementById('startNewGameButton').style.display = null;
Core.prepareNewRound();
document.getElementById('currentScoreSum').innerHTML = String(0);
},
prepareNewRound: function () {
@@ -91,6 +98,8 @@
Core.panorama.setVisible(false);
document.getElementById('loading').style.visibility = 'visible';
document.getElementById('currentRound').innerHTML = String(Core.rounds.length) + '/' + String(Core.NUMBER_OF_ROUNDS);
Core.getNewPosition();
},
@@ -141,6 +150,8 @@
var score = Core.calculateScore(distance);
Core.scoreSum += score;
document.getElementById('currentScoreSum').innerHTML = String(Core.scoreSum) + '/' + String(Core.rounds.length * Core.MAX_SCORE);
Core.saveToSession();
Core.guessMarker.setMap(null);
@@ -277,7 +288,7 @@
Core.map.fitBounds(resultBounds);
document.getElementById('scoreSum').innerHTML = Core.scoreSum;
document.getElementById('scoreSum').innerHTML = String(Core.scoreSum);
var scoreBarProperties = Core.calculateScoreBarProperties(Core.scoreSum, Core.NUMBER_OF_ROUNDS * Core.MAX_SCORE);
var scoreBar = document.getElementById('scoreBar');