import { System } from '@serpentity/serpentity';
-import { SAT } from 'matter-js';
+import { Collision } from 'matter-js';
import BodyComponent from '../components/body';
import PointsColliderNode from '../nodes/points_collider';
const pointsTarget = collider.pointsCollider.pointsTarget;
if (collisionTargetBody) {
- const collision = SAT.collides(collider.body.body, collisionTargetBody.body);
- if (collision.collided) {
+ const collision = Collision.collides(collider.body.body, collisionTargetBody.body);
+ if (collision && collision.collided) {
points[pointsTarget] = (points[pointsTarget] || 0) + 1;
}
}
}
}
}
-};
+}