Add clear and endclear animations

This commit is contained in:
LoveEevee
2018-09-26 03:26:42 +03:00
parent 8226123c1b
commit fa818ad370
6 changed files with 32 additions and 13 deletions

View File

@@ -749,7 +749,8 @@ class View{
})
}
}else{
if(this.assets.don.getAnimation() === "gogo"){
var animation = this.assets.don.getAnimation()
if(animation === "gogo" || this.controller.getGlobalScore().hp >= 50 && animation === "normal"){
this.assets.don.normalAnimation()
}
if(ms >= this.gogoTimeStarted + 100){
@@ -770,10 +771,24 @@ class View{
don.setAnimation("10combo")
var ms = this.controller.getElapsedTime().ms
don.setAnimationStart(ms)
var length = don.getAnimationLength("normal")
don.setUpdateSpeed(this.beatInterval / (length / 4))
var length = don.getAnimationLength("10combo")
don.setAnimationEnd(ms + length * don.speed, don.normalAnimation)
}
}
gameEnded(){
if(this.controller.getGlobalScore().hp >= 50){
var don = this.assets.don
don.setAnimation("endclear")
var ms = this.controller.getElapsedTime().ms
don.setAnimationStart(ms)
var length = don.getAnimationLength("normal")
don.setUpdateSpeed(this.beatInterval / (length / 4))
var length = don.getAnimationLength("endclear")
don.setAnimationEnd(ms + length * don.speed, don.normalAnimation)
}
}
onmousemove(event){
this.lastMousemove = this.controller.getElapsedTime().ms
this.cursorHidden = false