From 3ea9bc869029c8251949579807f959c3c6b37939 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Sun, 2 Dec 2018 19:53:12 +0300 Subject: [PATCH] Fade in when hitting drumrolls and balloons --- public/src/js/game.js | 2 ++ public/src/js/view.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/src/js/game.js b/public/src/js/game.js index 3072cf4..9f77204 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -258,6 +258,7 @@ class Game{ } this.globalScore.drumroll ++ this.globalScore.points += score + this.view.setDarkBg(false) } checkDrumroll(circle, keysKa){ var ms = this.elapsedTime @@ -283,6 +284,7 @@ class Game{ this.view.drumroll.push(circleAnim) this.globalScore.drumroll++ this.globalScore.points += score * (dai ? 2 : 1) + this.view.setDarkBg(false) } whenLastCirclePlayed(){ var ms = this.elapsedTime diff --git a/public/src/js/view.js b/public/src/js/view.js index 7ff24fd..964631e 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -1478,10 +1478,12 @@ explosion.setAnimation(false) }) } - var miss = score === 0 + this.setDarkBg(score === 0) }else{ - var miss = true + this.setDarkBg(true) } + } + setDarkBg(miss){ if(!miss && this.darkDonBg){ this.darkDonBg = false this.donBg.classList.remove("donbg-dark")