-
-const AABB &World::TileShapeAt(Vector<int> pos) const {
- tileShape = AABB(pos, Vector<float>(1, 1));
- return tileShape;
+void World::EntityCollision() {
+ if (entities.size() <= 1) return;
+
+ auto firstEnd(entities.end());
+ --firstEnd;
+ for (auto first(entities.begin()); first != firstEnd; ++first) {
+ auto second(first);
+ ++second;
+ for (auto secondEnd(entities.end()); second != secondEnd; ++second) {
+ if ((*first)->bounds.Intersects((*second)->bounds)) {
+ // damage + knockback
+ }
+ }
+ }