This commit is contained in:
oc 2018-03-08 23:21:33 +08:00
parent f557aaf553
commit 79f0854371
2 changed files with 10 additions and 2 deletions

View File

@ -1353,8 +1353,10 @@ actions.prototype.clickSwitchs = function (x,y) {
core.musicStatus.bgmStatus = !core.musicStatus.bgmStatus;
if (core.musicStatus.bgmStatus)
core.resumeBgm();
else
else {
core.pauseBgm();
core.musicStatus.playingBgm = null;
}
core.setLocalStorage('bgmStatus', core.musicStatus.bgmStatus);
core.ui.drawSwitchs();
break;

View File

@ -300,6 +300,8 @@ control.prototype.startGame = function (hard, callback) {
////// 重新开始游戏;此函数将回到标题页面 //////
control.prototype.restart = function() {
this.showStartAnimate();
if (core.bgms.length>0)
core.playBgm(core.bgms[0]);
}
@ -1994,7 +1996,11 @@ control.prototype.resumeBgm = function () {
}
else {
if (core.bgms.length>0) {
core.playBgm(core.bgms[0]);
if (core.isset(core.floors[core.status.floorId].bgm)) {
core.playBgm(core.floors[core.status.floorId].bgm);
}
else
core.playBgm(core.bgms[0]);
core.musicStatus.isPlaying = true;
}
}