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 gxxaxx

Have a simple game.
Player vs. Monsters.

I'm killing the monsters okay this.kill()

Was wondering though, where would I put my logic to determine when all of the monsters have been "killed".

Thanks,
Claude

1 decade ago by delly

maybe on main.js or your main game loop ?

something like:
var monsters = this.getEntitiesByType( EntityMonster );
if (monsters.length == 0) {
   // All of monster have been killed
}

1 decade ago by gxxaxx

That worked like a charm. Thanks.
Claude
Page 1 of 1
« first « previous next › last »