More bug fixes

- BPM and go go time change even when there are no notes after the change, seen in Ego Ego Atakushi and UFO Swingin'
- Maker URL can be added to a local tja
  - Example: `MAKER: Creator name <https://example.com/path>`
- Long list of settings scrolls more naturally with arrow keys
- When media engagement is low, gamepad users will not be able to proceed on the title screen until a mouse click or a key press unpauses the audio context
- Fix "Bad" note gauge judgement on easy difficulty
- In debug, use hash to tell apart songs
This commit is contained in:
LoveEevee
2020-03-12 07:59:28 +03:00
parent a899fd5cfe
commit e81bf9b480
11 changed files with 131 additions and 43 deletions

View File

@@ -4,7 +4,8 @@ class Game{
this.selectedSong = selectedSong
this.songData = songData
this.elapsedTime = 0
this.currentCircle = 0
this.currentCircle = -1
this.updateCurrentCircle()
this.combo = 0
this.rules = new GameRules(this)
this.globalScore = {
@@ -46,7 +47,13 @@ class Game{
}
initTiming(){
// Date when the chrono is started (before the game begins)
var firstCircle = this.songData.circles[0]
var firstCircle
for(var i = 0; i < this.songData.circles.length; i++){
firstCircle = this.songData.circles[i]
if(firstCircle.type !== "event"){
break
}
}
if(this.controller.calibrationMode){
var offsetTime = 0
}else{
@@ -98,12 +105,6 @@ class Game{
this.controller.playSound("v_renda")
}
}
if(!circle.beatMSCopied){
if(this.view.beatInterval !== circle.beatMS){
this.view.changeBeatInterval(circle.beatMS)
}
circle.beatMSCopied = true
}
}
if(circle.daiFailed && (ms >= circle.daiFailed.ms + this.rules.daiLeniency || ms > endTime)){
this.checkScore(circle, circle.daiFailed.check)
@@ -237,6 +238,9 @@ class Game{
}
}
skipNote(circle){
if(circle.type === "event"){
return
}
if(circle.section){
this.resetSection()
}
@@ -254,6 +258,9 @@ class Game{
checkPlays(){
var circles = this.songData.circles
var circle = circles[this.currentCircle]
if(circle && circle.type === "event"){
this.updateCurrentCircle()
}
if(this.controller.autoPlayEnabled){
while(circle && this.controller.autoPlay(circle)){
@@ -460,16 +467,23 @@ class Game{
this.globalScore.points += score * (dai ? 2 : 1)
this.view.setDarkBg(false)
}
getLastCircle(circles){
for(var i = circles.length; i--;){
if(circles[i].type !== "event"){
return circles[i]
}
}
}
whenLastCirclePlayed(){
var ms = this.elapsedTime
if(!this.lastCircle){
var circles = this.songData.circles
var circle = circles[circles.length - 1]
var circle = this.getLastCircle(circles)
this.lastCircle = circle ? circle.endTime : 0
if(this.controller.multiplayer){
var syncWith = this.controller.syncWith
var syncCircles = syncWith.game.songData.circles
circle = syncCircles[syncCircles.length - 1]
circle = this.getLastCircle(syncCircles)
var syncLastCircle = circle ? circle.endTime : 0
if(syncLastCircle > this.lastCircle){
this.lastCircle = syncLastCircle
@@ -607,7 +621,7 @@ class Game{
var circles = this.songData.circles
do{
var circle = circles[++this.currentCircle]
}while(circle && circle.branch && !circle.branch.active)
}while(circle && (circle.branch && !circle.branch.active || circle.type === "event"))
}
getCurrentCircle(){
return this.currentCircle