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 Nico

Hey guys so I'm using the health bar entity snippet from pointofimpact.

It works fine for my player entity but I can't seem to make it work for any of the enemy entities.

Shouldn't it just work if I have health and MaxHealth set and this snippet in the init code?

        if( !ig.global.wm ) {
            ig.game.spawnEntity(EntityHealthBar, this.pos.x, this.pos.y,{ Unit: this });
        }

It might help me if I knew what !ig.global.wm actually does :/

EDIT: Got it. I had changed something in the original health bar code to hard code the position to my players gui :P

1 decade ago by jswart

ig.global.wm is the namespace that WeltMeister uses.

I think that line of code is saying:

if ( !ig.global.wm ) === 'if this entity was not spawned in weltmeister' then spawn the entity with the settings provided.

I haven't used that code before though. Are your loading your enemy entities by hand in the level editor? If so then that code isn't running.

EDIT: You would want that snippet in the init code of the EnemyEntity, not just the PlayerEntity.
Page 1 of 1
« first « previous next › last »