Add background music

This commit is contained in:
LoveEevee 2019-04-05 12:36:14 +03:00
parent 78528b424c
commit 3f533a0255
3 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -151,7 +151,8 @@ var assets = {
"audioMusic": [
"bgm_songsel.mp3",
"bgm_result.mp3",
"bgm_setsume.mp3"
"bgm_setsume.mp3",
"bgm_settings.mp3"
],
"fonts": [
"Kozuka",

View File

@ -53,6 +53,8 @@ class SettingsView{
constructor(touchEnabled){
this.touchEnabled = touchEnabled
loader.changePage("settings", true)
assets.sounds["bgm_settings"].playLoop(0.1, false, 0, 1.392, 26.992)
this.endButton = document.getElementById("tutorial-end-button")
if(touchEnabled){
document.getElementById("tutorial-outer").classList.add("touch-enabled")
@ -141,6 +143,7 @@ class SettingsView{
settings.setItem(name, value)
this.selected = this.items.findIndex(item => item.id === name)
this.items[this.selected].valueDiv.innerText = this.getValue(name)
assets.sounds["se_ka"].play()
}
keyEvent(event){
if(event.keyCode === 27 || event.keyCode === 8 || event.keyCode === 9){
@ -171,6 +174,7 @@ class SettingsView{
selected.settingBox.classList.remove("selected")
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
this.items[this.selected].settingBox.classList.add("selected")
assets.sounds["se_ka"].play()
}else if(name === "back"){
this.onEnd()
}
@ -192,6 +196,7 @@ class SettingsView{
}
clean(){
this.gamepad.clean()
assets.sounds["bgm_settings"].stop()
pageEvents.keyRemove(this, "all")
for(var i in this.items){
pageEvents.remove(this.items[i].settingBox, ["mousedown", "touchstart"])