NpcExtensions extension
Created by
─▄▀─▄▀ ──▀──▀ █▀▀▀▀▀█▄ █░░░░░█─█ ▀▄▄▄▄▄▀▀
Rafaelbarbosatec on 22/03/22
- on
Properties
- playerRect → Rect
-
Gets player position used how base in calculations
no setter
Methods
-
getAngleFromPlayer(
) → double - Get angle between enemy and player player as a base
-
getInverseAngleFromPlayer(
) → double - Get angle between enemy and player enemy position as a base
-
seeAndMoveToAlly(
{required dynamic closeAlly(Ally), VoidCallback? notObserved, VoidCallback? observed, VoidCallback? notCanMove, double radiusVision = 32, double? visionAngle, double? angle, double margin = 10, bool runOnlyVisibleInScreen = true}) → void -
Checks whether the ally is within range. If so, move to it.
visionAngle
in radiansangle
in radians. is automatically picked up using the component's direction. -
seeAndMoveToEnemy(
{required dynamic closeEnemy(Enemy), VoidCallback? notObserved, VoidCallback? observed, VoidCallback? notCanMove, double radiusVision = 32, double? visionAngle, double? angle, double margin = 10, bool runOnlyVisibleInScreen = true}) → void -
Checks whether the player is within range. If so, move to it.
visionAngle
in radiansangle
in radians. is automatically picked up using the component's direction. -
seeAndMoveToPlayer(
{required dynamic closePlayer(Player), VoidCallback? notObserved, VoidCallback? observed, VoidCallback? notCanMove, double radiusVision = 32, double margin = 10, double? visionAngle, double? angle, bool runOnlyVisibleInScreen = true}) → Shape? -
Checks whether the player is within range. If so, move to it.
visionAngle
in radiansangle
in radians. is automatically picked up using the component's direction. -
seePlayer(
{required dynamic observed(Player), VoidCallback? notObserved, double radiusVision = 32, double? visionAngle, double? angle}) → Shape? -
This method we notify when detect the player when enter in
radiusVision
configuration Method that bo used in update method.visionAngle
in radiansangle
in radians. is automatically picked up using the component's direction.