How a "Collision System" should be implemented?
- by nathan
My game is written using a entity system approach using Artemis Framework. Right know my collision detection is called from the Movement System but i'm wondering if it's a proper way to do collision detection using such an approach.
Right know i'm thinking of a new system dedicated to collision detection that would proceed all the solid entities to check if they are in collision with another one.
I'm wondering if it's a correct way to handle collision detection with an entity system approach? Also, how should i implement this collision system?
I though of an IntervalEntitySystem that would check every 200ms (this value is chosen regarding the Artemis documentation) if some entities are colliding.
protected void processEntities(ImmutableBag<Entity> ib) {
for (int i = 0; i < ib.size(); i++) {
Entity e = ib.get(i);
//check of collision with other entities here
}
}