keepDistance method
Implementation
bool keepDistance(GameComponent target, double minDistance) {
if (!isVisible) return true;
double distance = rectCollision.centerVector2.distanceTo(
target.rectCollision.centerVector2,
);
if (distance < minDistance) {
var angle = getAngleFromTarget(target);
moveFromAngle(angle + pi);
return false;
}
return true;
}