MovementExtensions extension

on

Methods

keepDistance(GameComponent target, double minDistance) bool

Available on Movement, provided by the MovementExtensions extension

moveTowardsTarget<T extends GameComponent>({required T target, Function? close, double margin = 4, MovementAxis movementAxis = MovementAxis.all}) bool

Available on Movement, provided by the MovementExtensions extension

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

Available on Movement, provided by the MovementExtensions extension

Checks whether the component is within range. If so, position yourself and keep your distance. Method that bo used in update method.