onCollision method
onCollision is called in every tick when this object is colliding with
other
.
Implementation
@override
@mustCallSuper
void onCollision(Set<Vector2> intersectionPoints, PositionComponent other) {
final otherEntity = _findEntity(other);
if (otherEntity == null) {
return;
}
for (final behavior in _propagateToBehaviors) {
if (behavior.isValid(otherEntity)) {
behavior.onCollision(intersectionPoints, otherEntity);
}
}
super.onCollision(intersectionPoints, other);
}