Calculate multiplier

This commit is contained in:
Diego Marcos
2018-10-15 17:41:32 -07:00
parent 39f214541b
commit 3bee7197ca

View File

@@ -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);
}