SongSelect: Add ura difficulty

This commit is contained in:
LoveEevee
2018-10-12 21:04:28 +03:00
parent 6ccdc18ec6
commit f80565f25b
17 changed files with 141 additions and 70 deletions

View File

@@ -2,11 +2,7 @@
constructor(){
var AudioContext = window.AudioContext || window.webkitAudioContext
this.context = new AudioContext()
pageEvents.once(window, "click").then(() => {
if(this.context.state === "suspended"){
this.context.resume()
}
})
pageEvents.add(window, ["click", "touchend"], this.pageClicked.bind(this))
}
load(url, gain){
return loader.ajax(url, request => {
@@ -48,6 +44,11 @@
source.connect(sound.gain.gainNode || this.context.destination)
return source
}
pageClicked(){
if(this.context.state === "suspended"){
this.context.resume()
}
}
}
class SoundGain{
constructor(soundBuffer, channel){