1 decade ago by MikeL
I'm working on a way to create a close approximation of Ruby symbols in impact. I've got it working with a plugin such that if I put within MyGame in my main.js file:
I can then use:
in my entities and it will have had a number automatically asigned to it. Saves having to asign say STATE{JUMPING: 1, RUNNING: 2, etc.} and allows the symbol to be used anywhere within any class. Within the Symbols class it does:
in order to allow for the shortcut version and allow it to be accessible everywhere.
It works great within the game. The problem is that I get an error in Weltmeister. This is because the entities may be referring to say ig.s.JUMPING, but Weltmeister doesn't know what ig.s is. It will throw an Uncaught TypeError.
Is there a simple way to get Weltmeister to recognize the custom class and shortcut naming (ig.s)?
symbols: new ig.Symbols("JUMPING RUNNING HIDING etc."),
I can then use:
ig.s.JUMPING
in my entities and it will have had a number automatically asigned to it. Saves having to asign say STATE{JUMPING: 1, RUNNING: 2, etc.} and allows the symbol to be used anywhere within any class. Within the Symbols class it does:
ig.s = this;
in order to allow for the shortcut version and allow it to be accessible everywhere.
It works great within the game. The problem is that I get an error in Weltmeister. This is because the entities may be referring to say ig.s.JUMPING, but Weltmeister doesn't know what ig.s is. It will throw an Uncaught TypeError.
Is there a simple way to get Weltmeister to recognize the custom class and shortcut naming (ig.s)?