align(self, target) {
Vector desiredVelocity = target.Velocity();
Vector steerForce = Vector.sub(desiredVelocity, currentVelocity)
steerForce.limit(maxforce);
self.applyForce(steer);
}
cohesion(self, target) {
Vector relPosition = target.Position() - self.Position();
Vector steerForce = Vector.sub(relPosition, target.Velocity() );
steerForce.limit(maxforce);
self.applyForce(steer);
}
seperation(self, target) {
Vector relPosition = target.Position() - self.Position();
distance = relPosition.Magnitude();
if distance < threshold:
Vector steerForce = -1 * relPosition;
steerForce.limit(maxforce);
self.applyForce(steer);
}