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 harryfeng

is there a way to find out the name of game class that an entity is in?

1 decade ago by dominic

The currently running Game instance can always be accessed at ig.game (lowercase 'g').

But you want the name of the instance? As in the default MyGame? Due to JavaScript's nature, there's no direct way to figure out the Class Name of an object instance. You can however do stuff like this:
if( ig.game instanceof MyGame ) { ... }

What exactly are you trying to do? Maybe there's a misunderstanding.
Page 1 of 1
« first « previous next › last »