dragonblocks.loadTexture = function(path){
new dragonblocks.Texture(path);
};
-(_ => {
+{
let textures = $.getJSON({
url: "api.php",
method: "POST",
}).responseJSON;
for(let i in textures)
dragonblocks.loadTexture(textures[i]);
-})();
+}
dragonblocks.getTexture = function(texture){
if(! texture)
return "none";
else
return sound;
};
-(_ => {
+{
let sounds = $.getJSON({
url: "api.php",
method: "POST",
}).responseJSON;
for(let i in sounds)
dragonblocks.loadSound(sounds[i]);
-})();
+}
dragonblocks.playSound = function(sound){
new Audio(dragonblocks.getSound(sound)).play();
}