Parsesong: Fix drumroll timing

This commit is contained in:
LoveEevee 2018-09-27 18:31:57 +03:00
parent ad7eff3e11
commit 92d3165744
5 changed files with 20 additions and 8 deletions

View File

@ -5,7 +5,7 @@
background-size: cover;
}
#game.default-bg{
background-size: contain;
background-size: calc(100vh / 720 * 512);
}
#canvas{
position: relative;

View File

@ -190,17 +190,18 @@ kbd{
}
@keyframes bgscroll{
from{
background-position: 0 0;
background-position: 0 center;
}
to{
background-position: calc(-100vh / 720 * 512) 0;
background-position: calc(-100vh / 720 * 512) center;
}
}
#song-select{
width: 100%;
height: 100%;
background-image: url("/assets/img/bg_genre_0.png");
background-size: contain;
background-size: calc(100vh / 720 * 512);
background-repeat: repeat no-repeat;
animation: bgscroll 16s infinite linear;
white-space: nowrap;
transition: background-image 0.5s;

View File

@ -8,7 +8,7 @@ class Mekadon{
play(circle){
var type = circle.getType()
if((type === "balloon" || type === "drumroll" || type === "daiDrumroll") && this.getMS() > circle.getEndTime()){
circle.played(0, false)
circle.played(-1, false)
this.game.updateCurrentCircle()
}
type = circle.getType()

View File

@ -122,7 +122,8 @@ class ParseSong{
start: start,
sliderMultiplier: sliderMultiplier,
measure: parseInt(values[this.osu.METER]),
gogoTime: parseInt(values[this.osu.KIAIMODE])
gogoTime: parseInt(values[this.osu.KIAIMODE]),
beatLength: msOrPercent
})
}
return timingPoints
@ -233,12 +234,14 @@ class ParseSong{
var gogoTime = false
var osuType = parseInt(values[this.osu.TYPE])
var hitSound = parseInt(values[this.osu.HITSOUND])
var beatLength = speed
for(var j = 0; j < this.timingPoints.length; j++){
if(this.timingPoints[j].start > start){
break
}
speed = this.timingPoints[j].sliderMultiplier
beatLength = this.timingPoints[j].beatLength
gogoTime = this.timingPoints[j].gogoTime
}
@ -261,8 +264,14 @@ class ParseSong{
}else if(osuType & this.osu.SLIDER){
var extras = values.slice(this.osu.EXTRAS)
var pixelLength = parseFloat(extras[this.osu.PIXELLENGTH])
var endTime = start + pixelLength / (speed * 100) * this.beatInfo.beatInterval
var distance = parseFloat(extras[this.osu.PIXELLENGTH])
var speedMultiplier = beatLength < 0 ? 100.0 / -beatLength : 1
var speedAdjustedBeatLength = this.beatInfo.beatInterval / speedMultiplier
var taikoVelocity = 100 * this.difficulty.sliderMultiplier / speedAdjustedBeatLength
var taikoDuration = distance / taikoVelocity
var endTime = start + taikoDuration
if(hitSound & this.osu.FINISH){
type = "daiDrumroll"
txt = "連打(大)ーっ!!"

View File

@ -121,6 +121,7 @@ class Scoresheet{
selected.click()
}else if(code == 37 || code == 39 || code == 67 || code == 78){
// Left, Right, C, N
assets.sounds["ka"].play()
selected.classList.remove("selected")
var next = selected.nextElementSibling
if(!next){
@ -130,6 +131,7 @@ class Scoresheet{
}
}
clean(){
this.gamepad.clean()
assets.sounds["bgm_result"].stop()
pageEvents.keyRemove(this, "all")
pageEvents.remove(window, "resize")