From: Elias Fleckenstein Date: Sun, 21 Jun 2020 14:47:40 +0000 (+0200) Subject: Changed ressources.js X-Git-Tag: 3.0 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=d786f935279ac147ae8d4b1f4f9a93b2d4edee0d;p=dragonblocks.git Changed ressources.js --- diff --git a/engine/ressources.js b/engine/ressources.js index 47c23f8..4aec9a6 100755 --- a/engine/ressources.js +++ b/engine/ressources.js @@ -31,7 +31,7 @@ dragonblocks.textures = {}; dragonblocks.loadTexture = function(path){ new dragonblocks.Texture(path); }; -(_ => { +{ let textures = $.getJSON({ url: "api.php", method: "POST", @@ -39,7 +39,7 @@ dragonblocks.loadTexture = function(path){ }).responseJSON; for(let i in textures) dragonblocks.loadTexture(textures[i]); -})(); +} dragonblocks.getTexture = function(texture){ if(! texture) return "none"; @@ -75,7 +75,7 @@ dragonblocks.getSound = function(sound){ else return sound; }; -(_ => { +{ let sounds = $.getJSON({ url: "api.php", method: "POST", @@ -83,7 +83,7 @@ dragonblocks.getSound = function(sound){ }).responseJSON; for(let i in sounds) dragonblocks.loadSound(sounds[i]); -})(); +} dragonblocks.playSound = function(sound){ new Audio(dragonblocks.getSound(sound)).play(); }