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 lazer

I always figured setting "type", "checkAgainst", and "collide" create recurring processes while the entity is alive - is this right or am I mistaken? And if this is the case, would there be any benefit in setting everything to none/never until these checks are actually required?

Eg I have various kinds of enemy entities that do not need to have a type or checkAgainst setting until a bullet is spawned. Is it worth me setting them to NONE and then setting them again when the player shoots?

1 decade ago by quidmonkey

You only save time if you set all three to no collision:
entity.type == ig.Entity.TYPE.NONE &&
entity.checkAgainst == ig.Entity.TYPE.NONE &&
entity.collides == ig.Entity.COLLIDES.NEVER

Otherwise, checkAgainst & type govern whether or not check() gets called, and collides dictates what happens during collision resolution.

1 decade ago by lazer

Thanks, quidmonkey, that helps. I've already been setting as much as possible to none/never so I can set all three to no collision in at least several entities.
Page 1 of 1
« first « previous next › last »