Fade in when hitting drumrolls and balloons

This commit is contained in:
LoveEevee 2018-12-02 19:53:12 +03:00
parent 6d770e7b2d
commit 3ea9bc8690
2 changed files with 6 additions and 2 deletions

View File

@ -258,6 +258,7 @@ class Game{
} }
this.globalScore.drumroll ++ this.globalScore.drumroll ++
this.globalScore.points += score this.globalScore.points += score
this.view.setDarkBg(false)
} }
checkDrumroll(circle, keysKa){ checkDrumroll(circle, keysKa){
var ms = this.elapsedTime var ms = this.elapsedTime
@ -283,6 +284,7 @@ class Game{
this.view.drumroll.push(circleAnim) this.view.drumroll.push(circleAnim)
this.globalScore.drumroll++ this.globalScore.drumroll++
this.globalScore.points += score * (dai ? 2 : 1) this.globalScore.points += score * (dai ? 2 : 1)
this.view.setDarkBg(false)
} }
whenLastCirclePlayed(){ whenLastCirclePlayed(){
var ms = this.elapsedTime var ms = this.elapsedTime

View File

@ -1478,10 +1478,12 @@
explosion.setAnimation(false) explosion.setAnimation(false)
}) })
} }
var miss = score === 0 this.setDarkBg(score === 0)
}else{ }else{
var miss = true this.setDarkBg(true)
} }
}
setDarkBg(miss){
if(!miss && this.darkDonBg){ if(!miss && this.darkDonBg){
this.darkDonBg = false this.darkDonBg = false
this.donBg.classList.remove("donbg-dark") this.donBg.classList.remove("donbg-dark")