EnemyExtensions extension
Functions util to use in your Enemy
- on
Methods
-
seeAndMoveToAttackRange(
{dynamic positioned(Player)?, BoolCallback? notObserved, dynamic observed(Player)?, double radiusVision = 32, double? visionAngle, double? angle, double? minDistanceFromPlayer, bool useDiagonal = true}) → void -
Available on Enemy, provided by the EnemyExtensions extension
Checks whether the player is within range. If so, move to it.visionAnglein radiansanglein radians. is automatically picked up using the component's direction. -
simpleAttackMelee(
{required double damage, required Vector2 size, int? id, int interval = 1000, bool withPush = false, double? sizePush, Direction? direction, Future< SpriteAnimation> ? animationRight, VoidCallback? execute, Vector2? centerOffset}) → void -
Available on Enemy, provided by the EnemyExtensions extension
Execute simple attack melee using animation -
simpleAttackRange(
{required Future< SpriteAnimation> animation, required Future<SpriteAnimation> animationDestroy, required Vector2 size, Vector2? destroySize, int? id, double speed = 150, double damage = 1, int interval = 1000, bool withCollision = true, bool useAngle = false, ShapeHitbox? collision, VoidCallback? onDestroy, VoidCallback? execute, LightingConfig? lightingConfig}) → void -
Available on Enemy, provided by the EnemyExtensions extension
Execute the ranged attack using a component with animation