Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aitor

I want to have some general properties for my game that can be accesed from anywhere, and I thought that the best Idea is to put them in the game object (defined in main.js). I tried to put 'game.main' in the requires function of my entity and then accesing the game object like this: MyGame.font.draw("Test",50,50); but I get this error:
uncaught exception: Unresolved (circular?) dependencies. Most likely there's a name/path mismatch for one of the listed modules: game.main (requires: game.entities.copter, game.levels.main) game.levels.main (requires: game.entities.copter) game.entities.copter (requires: game.main)
I'm still new to javascript (It's the first scripting language I learn) so If there is a better way to achieve this please tell me. Thanks in advance

1 decade ago by Graphikos

Access anything with: ig.game

1 decade ago by Aitor

Thanks for the reply.
But will I be able to acces the properties of the subclass? or only the ones that are defined by ig.Game?
EDIT: Yes, it will (just checked). Thanks for the help!
Page 1 of 1
« first « previous next › last »