From 7958afc0f06f1c8190a68393ae3c819f5911d445 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Thu, 20 Sep 2018 20:04:22 +0300 Subject: [PATCH 1/2] Fix fire animation and dai notes --- public/src/js/game.js | 4 ++-- public/src/js/view.js | 4 ++-- public/src/js/viewassets.js | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/public/src/js/game.js b/public/src/js/game.js index 915b938..b61cd38 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -91,7 +91,7 @@ class Game{ }else if(currentTime > endTime){ if(drumrollNotes){ circle.updateStatus(-1) - circle.played(0) + circle.played(0, false) this.updateCurrentCircle() if(this.controller.multiplayer == 1){ p2.send("drumroll", { @@ -102,7 +102,7 @@ class Game{ if(!this.controller.autoPlayEnabled){ circle.updateStatus(-1) var currentScore = 0 - circle.played(currentScore) + circle.played(currentScore, type === "daiDon" || type === "daiKa") this.controller.displayScore(currentScore, true) this.updateCurrentCircle() this.updateCombo(currentScore) diff --git a/public/src/js/view.js b/public/src/js/view.js index b0de68a..d744afb 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -31,7 +31,7 @@ class View{ this.currentScore = 0 this.special = "" this.scoreDispCount = -1 - this.scoreOpacity = 1.0 + this.scoreOpacity = 1 this.lastMeasure = 0 this.currentTimingPoint = 0 @@ -418,7 +418,7 @@ class View{ var timeForDistance = this.posToMs(this.distanceForCircle + this.bigCircleSize / 2, speed) var startingTime = circle.getMS() - timeForDistance - var finishTime = circle.getEndTime() + this.posToMs(this.slotX - this.taikoSquareW + this.bigCircleSize / 2, speed) + var finishTime = circle.getEndTime() + this.posToMs(this.slotX - this.taikoSquareW + this.bigCircleSize * 3, speed) if(!circle.getPlayed() || circle.getScore() === 0){ if(ms >= startingTime && ms <= finishTime){ diff --git a/public/src/js/viewassets.js b/public/src/js/viewassets.js index 60a51f6..0faa67c 100644 --- a/public/src/js/viewassets.js +++ b/public/src/js/viewassets.js @@ -54,9 +54,12 @@ class ViewAssets{ var imgh = 370 var scale = 175 var ms = this.controller.getElapsedTime().ms - var grow = Math.min(100, ms - this.view.gogoTimeStarted) / 100 - if(!this.view.gogoTime){ - grow = 1 - grow + var elapsed = ms - this.view.gogoTimeStarted + if(this.view.gogoTime){ + var grow = 3 - Math.min(200, elapsed) / 100 + this.ctx.globalAlpha = Math.min(200, elapsed) / 200 + }else{ + var grow = 1 - Math.min(100, elapsed) / 100 } var w = (this.view.barH * imgw) / scale * grow var h = (this.view.barH * imgh) / scale * grow @@ -72,6 +75,7 @@ class ViewAssets{ h: h, callback: () => { this.ctx.globalCompositeOperation = "source-over" + this.ctx.globalAlpha = 1 } } }) From 448927ad45c0a9e23cf9a1d3cae9d16ad020ba85 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Thu, 20 Sep 2018 21:30:49 +0300 Subject: [PATCH 2/2] Fix tabbing out before drumrolls on auto play --- public/src/js/game.js | 34 +++++++++++++++++----------------- public/src/js/mekadon.js | 14 ++++++++++---- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/public/src/js/game.js b/public/src/js/game.js index b61cd38..0be543e 100644 --- a/public/src/js/game.js +++ b/public/src/js/game.js @@ -18,7 +18,7 @@ class Game{ } this.HPGain = 100 / this.songData.circles.filter(circle => { var type = circle.getType() - return type == "don" || type == "ka" || type == "daiDon" || type == "daiKa" + return type === "don" || type === "ka" || type === "daiDon" || type === "daiKa" }).length this.paused = false this.started = false @@ -89,17 +89,17 @@ class Game{ } } }else if(currentTime > endTime){ - if(drumrollNotes){ - circle.updateStatus(-1) - circle.played(0, false) - this.updateCurrentCircle() - if(this.controller.multiplayer == 1){ - p2.send("drumroll", { - pace: (this.getElapsedTime().ms - circle.getMS()) / circle.timesHit - }) - } - }else{ - if(!this.controller.autoPlayEnabled){ + if(!this.controller.autoPlayEnabled){ + if(drumrollNotes){ + circle.updateStatus(-1) + circle.played(0, false) + this.updateCurrentCircle() + if(this.controller.multiplayer === 1){ + p2.send("drumroll", { + pace: (this.getElapsedTime().ms - circle.getMS()) / circle.timesHit + }) + } + }else{ circle.updateStatus(-1) var currentScore = 0 circle.played(currentScore, type === "daiDon" || type === "daiKa") @@ -107,11 +107,11 @@ class Game{ this.updateCurrentCircle() this.updateCombo(currentScore) this.updateGlobalScore(currentScore, 1) - } - if(this.controller.multiplayer === 1){ - p2.send("note", { - score: -1 - }) + if(this.controller.multiplayer === 1){ + p2.send("note", { + score: -1 + }) + } } } } diff --git a/public/src/js/mekadon.js b/public/src/js/mekadon.js index 5758820..91b319f 100644 --- a/public/src/js/mekadon.js +++ b/public/src/js/mekadon.js @@ -8,9 +8,15 @@ class Mekadon{ } play(circle){ var type = circle.getType() - if(type == "balloon"){ + if((type === "balloon" || type === "drumroll" || type === "daiDrumroll") && this.getMS() > circle.getEndTime()){ + circle.updateStatus(-1) + circle.played(0, false) + this.game.updateCurrentCircle() + } + type = circle.getType() + if(type === "balloon"){ this.playDrumrollAt(circle, 0, 30) - }else if(type == "drumroll" || type == "daiDrumroll"){ + }else if(type === "drumroll" || type === "daiDrumroll"){ this.playDrumrollAt(circle, 0, 60) }else{ this.playAt(circle, 0, 450) @@ -59,12 +65,12 @@ class Mekadon{ this.setKey(this.lr ? kbd["ka_l"] : kbd["ka_r"]) this.lr = !this.lr } - if(type == "balloon"){ + if(type === "balloon"){ if(circle.requiredHits == 1){ assets.sounds["balloon"].play() } this.game.checkBalloon(circle) - }else if(type == "drumroll" || type == "daiDrumroll"){ + }else if(type === "drumroll" || type === "daiDrumroll"){ this.game.checkDrumroll(circle) }else{ if(typeof score == "undefined"){