1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| //fichier dispatcher.js
function Dispatcher(){
this.events='';//[];
}
//fichier config.js
function Config ()
{
this.clipping = 500;
this.assetFolder = 'http://127.0.0.1/jeux/assets/';
}
//fichier loader.js
function Loader (engine,level)
{
//CETTE FONCTION NE CHARGE PAS UN SCRIPT
//ELLE DEMANDE AU NAVIGATEUR D'AJOUTER UN SCRIPT
this.include = function(file){
var oScript = document.createElement("script");
oScript.src = file;
oScript.type = "text/javascript";
document.head.appendChild(oScript);}
//this.sceneLoaded = function () {return (isLoaded) ? this.scene : false}
//Code
this.include('/jeux/core/config.js');//Les deux fichiers sont bien chargés
//LE FICHIER N'EST PAS CHARGE. SEULE LA DEMANDE DE CHARGEMENT A ETE ENVOYEE
this.include('/jeux/core/dispatcher.js');//Les deux fichiers sont bien chargés
//LE FICHIER N'EST PAS CHARGE. SEULE LA DEMANDE DE CHARGEMENT A ETE ENVOYEE
//ON NE SAIT PAS QUAND LE CLIENT RECEVRA LES SCRIPTS
Config.call(this);
//FORTE CHANCE D'AVOIR UN UNDEFINED
Dispatcher.call(this);
//FORTE CHANCE D'AVOIR UN UNDEFINED
}
//Uncaught ReferenceError: Dispatcher is not defined -> loader.js:27 |
Partager