Now use the prestep event to update instead

This commit is contained in:
Richard Davey 2018-05-11 01:50:02 +01:00
parent 11cbf0cf8d
commit d595da49fd
2 changed files with 20 additions and 18 deletions

View file

@ -227,6 +227,7 @@ var InputManager = new Class({
this.touch.boot();
this.gamepad.boot();
this.game.events.on('prestep', this.update, this);
this.game.events.once('destroy', this.destroy, this);
},

View file

@ -116,24 +116,6 @@ var BaseSoundManager = new Class({
*/
this.pauseOnBlur = true;
game.events.on('blur', function ()
{
if (this.pauseOnBlur)
{
this.onBlur();
}
}, this);
game.events.on('focus', function ()
{
if (this.pauseOnBlur)
{
this.onFocus();
}
}, this);
game.events.once('destroy', this.destroy, this);
/**
* Property that actually holds the value of global playback rate.
*
@ -179,6 +161,25 @@ var BaseSoundManager = new Class({
* @since 3.0.0
*/
this.unlocked = false;
game.events.on('blur', function ()
{
if (this.pauseOnBlur)
{
this.onBlur();
}
}, this);
game.events.on('focus', function ()
{
if (this.pauseOnBlur)
{
this.onFocus();
}
}, this);
game.events.on('prestep', this.update, this);
game.events.once('destroy', this.destroy, this);
},
/**