collidedWithTheOther method
Implementation
void collidedWithTheOther(
Vector2 direction, [
Duration duration = Durations.medium3,
]) {
Vector2 impulse = direction * collisionSpeed;
collided = true;
body.applyLinearImpulse(impulse, point: body.worldCenter);
Future<void>.delayed(duration).then((_) {
collided = false;
_reposition();
});
}