Fixed glitches after pressed Escape key to restart game
This commit is contained in:
+2
-2
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user