mirror of
https://github.com/sbrl/soundbox.git
synced 2018-01-10 21:33:43 +00:00
Update soundbox.js
This commit is contained in:
parent
a1df146663
commit
565c587b34
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
soundbox = function() {
|
function SoundBox() {
|
||||||
this.sounds = {};
|
this.sounds = {};
|
||||||
this.sound_callbacks = {};
|
this.sound_callbacks = {};
|
||||||
this.add_sound = function(sound_name, path) {
|
this.add_sound = function(sound_name, path) {
|
||||||
|
@ -13,14 +13,14 @@ soundbox = function() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.remove_sound = function(sound_name) {
|
this.remove = function(sound_name) {
|
||||||
if(typeof this.sounds != "undefined")
|
if(typeof this.sounds != "undefined")
|
||||||
delete this.sounds[sound_name];
|
delete this.sounds[sound_name];
|
||||||
if(typeof this.sound_callbacks == "function")
|
if(typeof this.sound_callbacks == "function")
|
||||||
delete this.sound_callbacks[sound_name];
|
delete this.sound_callbacks[sound_name];
|
||||||
};
|
};
|
||||||
|
|
||||||
this.play_sound = function(sound_name, callback) {
|
this.play = function(sound_name, callback) {
|
||||||
if(typeof this.sounds[sound_name] == "undefined")
|
if(typeof this.sounds[sound_name] == "undefined")
|
||||||
{
|
{
|
||||||
console.error("Can't find sound called '" + sound_name + "'.");
|
console.error("Can't find sound called '" + sound_name + "'.");
|
||||||
|
|
Loading…
Reference in a new issue