Implemented remove method

This commit is contained in:
Pavle Goloskokovic 2018-01-04 19:41:43 +01:00
parent 5790fe9a4f
commit 5f56d038f5

View file

@ -134,7 +134,14 @@ var BaseSoundManager = new Class({
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));
sound.play(spriteName, config);
},
remove: NOOP,
remove: function (sound) {
var index = this.sounds.indexOf(sound);
if (index !== -1) {
this.sounds.splice(index, 1);
return true;
}
return false;
},
removeByKey: NOOP,
pauseAll: function () {
this.sounds.forEach(function (sound) {