MovementExtensions extension

on

Methods

keepDistance(GameComponent target, double minDistance) bool
moveTowardsTarget<T extends GameComponent>({required T target, Function? close, double margin = 4, MovementAxis movementAxis = MovementAxis.all}) bool
This method move this component to target Need use Movement mixin. Method that bo used in update method. return true if moved.
positionsItselfAndKeepDistance<T extends GameComponent>(T target, {dynamic positioned(T)?, double radiusVision = 32, double? minDistanceFromPlayer, bool runOnlyVisibleInScreen = true}) bool
Checks whether the component is within range. If so, position yourself and keep your distance. Method that bo used in update method.