I have scrip with this structure:
define('game-logic/clib',[], function () {
var audio = null;
return {
//Some functions....
localOrDef: function(name, def)
{
/....
},
}
});
And I have no idea, how this 'define' stuff on top works, I want to understand it, as I want to rewrite this script in such a way, so that I could call my functions like Clib.localOrDef(name,def), by including it with other scripts simply using:
"script type="text/javascript" src="js/clib.js"></script>"
This 'define('game-logic/clib',[], function ()' - how to replace it with the call to the static class?