imkost Posted August 17, 2014 Share Posted August 17, 2014 Look at Panda's Flying Dog example https://github.com/ekelokorpi/flyingdogEvery module has it's own require: game.module('game.objects').require('engine.renderer').body(function() { ... })game.module('game.scenes').require('engine.scene').body(function() { ... })game.module('game.main').require('game.assets', 'game.objects', 'game.scenes').body(function() { ... }) If you gather all requires into one module (game.main) game.module('game.objects').body(function() { ... })game.module('game.scenes').body(function() { ... })game.module('game.main').require('game.assets', 'game.objects', 'game.scenes', 'engine.renderer', 'engine.scene').body(function() { ... }) then everything still works. I find second method more convenient to use: you say what you want to use only once then just use it. Is there any advantages of the first method over the second one? Maybe there are reasons why second method is wrong? Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted August 18, 2014 Share Posted August 18, 2014 You can only require the ones you need inside current module. So if it's used by other modules, just don't mention them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.