Mugen87 / yuka

JavaScript library for developing Game AI.
https://mugen87.github.io/yuka/
MIT License
1.12k stars 91 forks source link

Question regarding entities and triggers, etc. #21

Closed Glidias closed 4 years ago

Glidias commented 4 years ago

Why iterate them backwards in EntityManager?

Mugen87 commented 4 years ago

The game entity might remove itself from the manager. Normal iteration would break in this use case.

Glidias commented 4 years ago

aha simple solution to a typical issue. But wouldn't it still be possible it can kill other entities during the update? I

Mugen87 commented 4 years ago

Yeah, the engine does not cover this use case. The convection is: A game entity is allowed to remove itself but no others.