mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
Add background music
This commit is contained in:
parent
78528b424c
commit
3f533a0255
BIN
public/assets/audio/bgm_settings.mp3
Normal file
BIN
public/assets/audio/bgm_settings.mp3
Normal file
Binary file not shown.
@ -151,7 +151,8 @@ var assets = {
|
|||||||
"audioMusic": [
|
"audioMusic": [
|
||||||
"bgm_songsel.mp3",
|
"bgm_songsel.mp3",
|
||||||
"bgm_result.mp3",
|
"bgm_result.mp3",
|
||||||
"bgm_setsume.mp3"
|
"bgm_setsume.mp3",
|
||||||
|
"bgm_settings.mp3"
|
||||||
],
|
],
|
||||||
"fonts": [
|
"fonts": [
|
||||||
"Kozuka",
|
"Kozuka",
|
||||||
|
@ -53,6 +53,8 @@ class SettingsView{
|
|||||||
constructor(touchEnabled){
|
constructor(touchEnabled){
|
||||||
this.touchEnabled = touchEnabled
|
this.touchEnabled = touchEnabled
|
||||||
loader.changePage("settings", true)
|
loader.changePage("settings", true)
|
||||||
|
assets.sounds["bgm_settings"].playLoop(0.1, false, 0, 1.392, 26.992)
|
||||||
|
|
||||||
this.endButton = document.getElementById("tutorial-end-button")
|
this.endButton = document.getElementById("tutorial-end-button")
|
||||||
if(touchEnabled){
|
if(touchEnabled){
|
||||||
document.getElementById("tutorial-outer").classList.add("touch-enabled")
|
document.getElementById("tutorial-outer").classList.add("touch-enabled")
|
||||||
@ -141,6 +143,7 @@ class SettingsView{
|
|||||||
settings.setItem(name, value)
|
settings.setItem(name, value)
|
||||||
this.selected = this.items.findIndex(item => item.id === name)
|
this.selected = this.items.findIndex(item => item.id === name)
|
||||||
this.items[this.selected].valueDiv.innerText = this.getValue(name)
|
this.items[this.selected].valueDiv.innerText = this.getValue(name)
|
||||||
|
assets.sounds["se_ka"].play()
|
||||||
}
|
}
|
||||||
keyEvent(event){
|
keyEvent(event){
|
||||||
if(event.keyCode === 27 || event.keyCode === 8 || event.keyCode === 9){
|
if(event.keyCode === 27 || event.keyCode === 8 || event.keyCode === 9){
|
||||||
@ -171,6 +174,7 @@ class SettingsView{
|
|||||||
selected.settingBox.classList.remove("selected")
|
selected.settingBox.classList.remove("selected")
|
||||||
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
|
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
|
||||||
this.items[this.selected].settingBox.classList.add("selected")
|
this.items[this.selected].settingBox.classList.add("selected")
|
||||||
|
assets.sounds["se_ka"].play()
|
||||||
}else if(name === "back"){
|
}else if(name === "back"){
|
||||||
this.onEnd()
|
this.onEnd()
|
||||||
}
|
}
|
||||||
@ -192,6 +196,7 @@ class SettingsView{
|
|||||||
}
|
}
|
||||||
clean(){
|
clean(){
|
||||||
this.gamepad.clean()
|
this.gamepad.clean()
|
||||||
|
assets.sounds["bgm_settings"].stop()
|
||||||
pageEvents.keyRemove(this, "all")
|
pageEvents.keyRemove(this, "all")
|
||||||
for(var i in this.items){
|
for(var i in this.items){
|
||||||
pageEvents.remove(this.items[i].settingBox, ["mousedown", "touchstart"])
|
pageEvents.remove(this.items[i].settingBox, ["mousedown", "touchstart"])
|
||||||
|
Loading…
Reference in New Issue
Block a user