1 decade ago by caranicas
Hi there, I'm from a C++ background and I think I am just having some difficulty understanding the module, requires, defines system. In my experience circular dependencies are a part of programming. two objects often need to know about one another. This is usually solved with #ifdef in the header file.
Ill explain my problem and hopefully that will make it clear. I made a win trigger and put it in my level. I am using check against to see when the player hits this trigger. (this part works) when he hits the trigger i wanted to go to the next level.
i am using a copy of Mike L.'s director plugin
http://impactjs.com/forums/impact-engine/new-director-level-manager-module
which i created inside my main game. I thought that if i made my game object a singleton that I would be able to require it in my win trigger create it and then go call
a wrapper function to go to the next level. but when i do this i get the following error
any help on this would be great. ill post all the relevant code in the following post
Ill explain my problem and hopefully that will make it clear. I made a win trigger and put it in my level. I am using check against to see when the player hits this trigger. (this part works) when he hits the trigger i wanted to go to the next level.
i am using a copy of Mike L.'s director plugin
http://impactjs.com/forums/impact-engine/new-director-level-manager-module
which i created inside my main game. I thought that if i made my game object a singleton that I would be able to require it in my win trigger create it and then go call
a wrapper function to go to the next level. but when i do this i get the following error
game.main (requires: game.states.main-game) game.states.main-game (requires: game.levels.one) game.levels.one (requires: game.entities.trigger-win) game.entities.trigger-win (requires: game.states.main-game)
any help on this would be great. ill post all the relevant code in the following post