calculate percentage/accuracy has score / scorePossible

This commit is contained in:
Kevin Ngo
2018-12-02 22:22:20 -08:00
parent f171a8e63a
commit 8908a97121

View File

@@ -448,9 +448,8 @@ AFRAME.registerState({
victory: function (state) {
state.isVictory = true;
const accuracy =
state.score.beatsHit /
(state.score.beatsMissed + state.score.beatsHit);
// Percentage is score divided by total possible score.
const accuracy = state.score / (state.score.beatsMissed + state.score.beatsHit) * 110;
state.score.accuracy = accuracy;
if (accuracy === 1) {