Fixed glitches after pressed Escape key to restart game

This commit is contained in:
Licson Lee
2015-01-11 20:06:32 +08:00
parent 342ab3e6e5
commit 51534de63e
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -101,8 +101,8 @@ bkcore.Audio.stop = function(id){
if(ctx){
if(bkcore.Audio.sounds[id].bufferNode !== null){
bkcore.Audio.sounds[id].bufferNode.disconnect();
bkcore.Audio.sounds[id].bufferNode = null;
var bufferNode = bkcore.Audio.sounds[id].bufferNode;
bufferNode.stop ? bufferNode.stop(ctx.currentTime) : bufferNode.noteOff(ctx.currentTime);
}
}
else {
+3 -1
View File
@@ -113,9 +113,11 @@ bkcore.hexgl.HexGL.prototype.reset = function()
this.manager.get('game').objects.lowFPS = 0;
this.gameplay.start();
bkcore.Audio.stop('bg');
bkcore.Audio.stop('wind');
bkcore.Audio.volume('wind', 0.35);
bkcore.Audio.play('bg');
bkcore.Audio.play('wind');
bkcore.Audio.volume('wind', 0.35);
}
bkcore.hexgl.HexGL.prototype.restart = function()