1 decade ago by danicor
I'm developing an application that contains many minigames... I need to load modules dynamically and not statically (module and requires) because the waiting time is getting longer with every new minigame.
I have some idea about this but I need help from someone who knows ImpactJS to make it clean.
Example of a first approach:
Example:
I have some idea about this but I need help from someone who knows ImpactJS to make it clean.
Example of a first approach:
Example:
ig._loadScript('X', 'Y'); setTimeout(loadGame, 3000); function loadGame() { var game = Task.getTaskName(get('game')); ig.main('#canvas', game, 60, window.innerWidth * scale, window.innerHeight * scale, 1, NptLoader); }