From 585b26fa2ec5dc69c073dc30aabf799b549a7536 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 29 Oct 2018 22:33:55 -0700 Subject: [PATCH] fix victory accuracy --- src/state/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/state/index.js b/src/state/index.js index 00357b4..32c8482 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -367,7 +367,9 @@ AFRAME.registerState({ victory: function (state) { state.isVictory = true; - const accuracy = state.beatsHit / (state.beatsMissed + state.beatsHit); + const accuracy = + state.score.beatsHit / + (state.score.beatsMissed + state.score.beatsHit); state.score.accuracy = accuracy; state.score.accuracyText = `${(accuracy * 100).toFixed()}%`;