handleCollision method

  1. @override
void handleCollision(
  1. Set<Vector2> intersectionPoints,
  2. ShapeHitbox hitboxA,
  3. ShapeHitbox hitboxB
)
override

Calls the two colliding hitboxes every tick when they are colliding. They are called with the intersectionPoints and instances of each other, so that they can determine what hitbox (and what ShapeHitbox.hitboxParent that they have collided with.

Implementation

@override
void handleCollision(
  Set<Vector2> intersectionPoints,
  ShapeHitbox hitboxA,
  ShapeHitbox hitboxB,
) {
  hitboxA.onCollision(intersectionPoints, hitboxB);
  hitboxB.onCollision(intersectionPoints, hitboxA);
}