P2: Multiplayer improvements

This commit is contained in:
LoveEevee
2018-11-13 07:36:15 +03:00
parent 1619622257
commit 25d705ffcf
10 changed files with 139 additions and 36 deletions

View File

@@ -106,6 +106,7 @@ class P2Connection{
this.notes = []
this.drumrollPace = 45
this.dai = 2
this.kaAmount = 0
this.results = false
break
case "gameend":
@@ -130,6 +131,9 @@ class P2Connection{
break
case "drumroll":
this.drumrollPace = response.value.pace
if("kaAmount" in response.value){
this.kaAmount = response.value.kaAmount
}
break
case "session":
this.clearMessage("users")
@@ -160,7 +164,7 @@ class P2Connection{
}
if(drumrollNotes){
mekadon.playDrumrollAt(circle, 0, this.drumrollPace)
mekadon.playDrumrollAt(circle, 0, this.drumrollPace, type === "drumroll" || type === "daiDrumroll" ? this.kaAmount : 0)
}else if(this.notes.length === 0){
mekadon.play(circle)
}else{
@@ -170,7 +174,7 @@ class P2Connection{
if(circle.getType() === "daiDon" || circle.getType() === "daiKa"){
dai = this.dai
}
if(mekadon.playAt(circle, note.ms, note.score, dai)){
if(mekadon.playAt(circle, note.ms, note.score, dai, note.reverse)){
this.notes.shift()
}
}else{