CanvasAsset: Change animation speed with bpm changes

This commit is contained in:
LoveEevee
2018-10-11 23:24:18 +03:00
parent 4ff567d5d7
commit 9c175231bf
7 changed files with 62 additions and 29 deletions

View File

@@ -3,7 +3,7 @@ class Game{
this.controller = controller
this.selectedSong = selectedSong
this.songData = songData
this.elapsedTime = {}
this.elapsedTime = 0
this.currentCircle = 0
this.combo = 0
this.rules = new GameRules(this)
@@ -38,6 +38,7 @@ class Game{
run(){
this.timeForDistanceCircle = 2500
this.initTiming()
this.view = this.controller.view
}
initTiming(){
// Date when the chrono is started (before the game begins)
@@ -75,6 +76,12 @@ class Game{
this.controller.playSound("renda")
}
}
if(!circle.beatMSCopied){
if(this.view.beatInterval !== circle.beatMS){
this.view.changeBeatInterval(circle.beatMS)
}
circle.beatMSCopied = true
}
}
if(ms > endTime){
if(!this.controller.autoPlayEnabled){
@@ -260,7 +267,7 @@ class Game{
})
circleAnim.played(score, dai)
circleAnim.animate(ms)
this.controller.view.drumroll.push(circleAnim)
this.view.drumroll.push(circleAnim)
this.globalScore.drumroll++
this.globalScore.points += score * (dai ? 2 : 1)
}
@@ -373,7 +380,7 @@ class Game{
if(this.combo === 50 || this.combo > 0 && this.combo % 100 === 0 && this.combo <= 1400){
this.controller.playSoundMeka("combo-" + this.combo)
}
this.controller.view.updateCombo(this.combo)
this.view.updateCombo(this.combo)
}
getCombo(){
return this.combo