1 decade ago by Joncom
I have an entity that looks something like:
I've defined my ENUM at the very top of main.js like so:
The problem is that Weltmeister complains because it has not run main.js:
So the question is, where is a good place to store ENUMS so that they are accessible to entities in Weltmeister?
EntityBullet = ig.Entity.extend({ checkAgainst: ig.Entity.TYPE.A, team: ig.ENUMS.TEAM.GOOD, init: function(x, y, settings) { this.parent(); } // etc... });
I've defined my ENUM at the very top of main.js like so:
ig.ENUMS = { TEAM: { GOOD: 1, BAD: 2, NEUTRAL: 0 } };
The problem is that Weltmeister complains because it has not run main.js:
Uncaught TypeError: Cannot read property 'TEAM' of undefined -- Line 8 bullet.js
So the question is, where is a good place to store ENUMS so that they are accessible to entities in Weltmeister?