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 fugufish

back to basic question:

i need to call the health property of an enemy entity.

i call var ent = this.getEntitiesByType(EntityEnemy)[0];

and console.log('health: ', ent.health) yields nothing.

am i missing something? I've already set the health property to 500 in EntityEnemy.

1 decade ago by igr

Hi, it resembles my problem which I posted the other day. It seems to take some iterations before the entities come to life (are not NULL). And null.health obviously returns nothing. Although not sure...

1 decade ago by fugufish

okay found out that it's all my bad.

it actually works! loadLevel must be called first (i.e entity must already be spawned)
Page 1 of 1
« first « previous next › last »