mirror of
https://github.com/yuukiwww/taiko-web.git
synced 2024-10-22 17:05:49 +02:00
Fix pressed keys and combo text
This commit is contained in:
parent
999648dfd7
commit
aeea39af00
@ -101,8 +101,8 @@ class View{
|
|||||||
this.drawScore()
|
this.drawScore()
|
||||||
this.drawCircles()
|
this.drawCircles()
|
||||||
this.drawTaikoSquare()
|
this.drawTaikoSquare()
|
||||||
this.drawPressedKeys()
|
|
||||||
this.drawDifficulty()
|
this.drawDifficulty()
|
||||||
|
this.drawPressedKeys()
|
||||||
this.drawCombo()
|
this.drawCombo()
|
||||||
this.drawGlobalScore()
|
this.drawGlobalScore()
|
||||||
this.updateDonFaces()
|
this.updateDonFaces()
|
||||||
@ -212,11 +212,6 @@ class View{
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawCombo(){
|
drawCombo(){
|
||||||
this.ctx.drawImage(assets.image.taiko,
|
|
||||||
this.taikoX, this.taikoY,
|
|
||||||
this.taikoW, this.taikoH
|
|
||||||
)
|
|
||||||
|
|
||||||
var comboCount = this.controller.getCombo()
|
var comboCount = this.controller.getCombo()
|
||||||
if(comboCount >= 10){
|
if(comboCount >= 10){
|
||||||
var comboX = this.taikoX + this.taikoW / 2
|
var comboX = this.taikoX + this.taikoW / 2
|
||||||
@ -249,14 +244,6 @@ class View{
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentTime = this.controller.getEllapsedTime().ms
|
|
||||||
if(comboCount % 100 == 0 && !this.comboHasText){
|
|
||||||
this.comboHasText = currentTime
|
|
||||||
}
|
|
||||||
if(currentTime >= this.comboHasText + 2000){
|
|
||||||
this.comboHasText = false
|
|
||||||
}
|
|
||||||
if(this.comboHasText){
|
|
||||||
var fontSize = this.taikoH * 0.12
|
var fontSize = this.taikoH * 0.12
|
||||||
if(comboCount >= 100){
|
if(comboCount >= 100){
|
||||||
var grd = this.ctx.createLinearGradient(0, comboY + fontSize * 0.5, 0, comboY + fontSize * 1.5)
|
var grd = this.ctx.createLinearGradient(0, comboY + fontSize * 0.5, 0, comboY + fontSize * 1.5)
|
||||||
@ -267,13 +254,11 @@ class View{
|
|||||||
this.ctx.fillStyle = "#fff"
|
this.ctx.fillStyle = "#fff"
|
||||||
}
|
}
|
||||||
this.ctx.font = "normal " + fontSize + "px TnT"
|
this.ctx.font = "normal " + fontSize + "px TnT"
|
||||||
this.ctx.globalAlpha = Math.min(4 - ((currentTime - this.comboHasText) / 500),1)
|
this.ctx.lineWidth = fontSize / 5
|
||||||
this.strokeFillText("コンボ",
|
this.strokeFillText("コンボ",
|
||||||
comboX,
|
comboX,
|
||||||
comboY + fontSize * 1.5
|
comboY + fontSize * 1.5
|
||||||
)
|
)
|
||||||
this.ctx.globalAlpha = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
this.scoreDispCount++
|
this.scoreDispCount++
|
||||||
}
|
}
|
||||||
@ -547,6 +532,11 @@ class View{
|
|||||||
this.diffX, this.diffY,
|
this.diffX, this.diffY,
|
||||||
this.diffW, this.diffH
|
this.diffW, this.diffH
|
||||||
)
|
)
|
||||||
|
|
||||||
|
this.ctx.drawImage(assets.image.taiko,
|
||||||
|
this.taikoX, this.taikoY,
|
||||||
|
this.taikoW, this.taikoH
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawTime(){
|
drawTime(){
|
||||||
|
Loading…
Reference in New Issue
Block a user