From 8908a971212634f0075fd6705c18f3d331196450 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Sun, 2 Dec 2018 22:22:20 -0800 Subject: [PATCH] calculate percentage/accuracy has score / scorePossible --- src/state/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/state/index.js b/src/state/index.js index 66383d7..6731dbc 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -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) {