RandomMovementApi class
API responsible for adding random movement behavior to a component.
The parent component must have a Movement mixin.
Constructors
- RandomMovementApi(Movement _comp)
Properties
- area ↔ ShapeHitbox?
-
Area where the random movement will be made.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Releases all registered callbacks.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onStartMoveListener(
OnRandomMovementStartCallback callback) → void - Registers a callback fired when random movement starts.
-
onStopMoveListener(
OnRandomMovementStopCallback callback) → void - Registers a callback fired when random movement stops.
-
run(
double dt) → void -
Executes random movement. Should be called inside the component's
updatemethod. -
setup(
{double? speed, double? maxDistance, double? minDistance, int? timeKeepStopped, bool? updateAngle, bool? checkDirectionWithRayCast, RandomMovementDirections? directions}) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited