MovementExtensions extension

on

Methods

followComponent(GameComponent target, double dt, {required dynamic closeComponent(GameComponent), double margin = 10}) → void
This method move this component to target Need use Movement mixin. Method that bo used in update method.
positionsItselfAndKeepDistance(GameComponent target, {required dynamic positioned(GameComponent), double radiusVision = 32, double? minDistanceFromPlayer, bool runOnlyVisibleInScreen = true}) → void
Checks whether the component is within range. If so, position yourself and keep your distance. Method that bo used in update method.