MovementExtensions extension

on

Methods

followComponent(GameComponent target, double dt, {required dynamic closeComponent(GameComponent), double margin = 10}) bool
This method move this component to target Need use Movement mixin. Method that bo used in update method. return true if moved.
positionsItselfAndKeepDistance(GameComponent target, {required dynamic positioned(GameComponent), 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.