From 3bee7197ca20c3225ef41f186099135a9fbb1bd3 Mon Sep 17 00:00:00 2001 From: Diego Marcos Date: Mon, 15 Oct 2018 17:41:32 -0700 Subject: [PATCH] Calculate multiplier --- src/state/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/state/index.js b/src/state/index.js index 1f46561..4e6384d 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -87,6 +87,7 @@ AFRAME.registerState({ } state.score.score += 1; state.score.combo += 1; + state.score.multiplier = state.score.combo >= 8 ? 8 : 2 * Math.floor(Math.log2(state.score.combo)); }, beatmiss: state => { @@ -329,6 +330,7 @@ function takeDamage (state) { if (!state.isPlaying) { return; } state.damage++; state.score.combo = 0; + state.score.multiplier = 1; checkGameOver(state); }