simpleAttackRangeByDirection method

void simpleAttackRangeByDirection({
  1. required Future<SpriteAnimation> animationRight,
  2. required Vector2 size,
  3. required Direction direction,
  4. required AttackFromEnum attackFrom,
  5. Vector2? destroySize,
  6. dynamic id,
  7. double speed = 150,
  8. double damage = 1,
  9. bool withCollision = true,
  10. bool enableDiagonal = true,
  11. VoidCallback? onDestroy,
  12. CollisionConfig? collision,
  13. LightingConfig? lightingConfig,
  14. Future<SpriteAnimation>? animationDestroy,
  15. double marginFromOrigin = 16,
  16. Vector2? centerOffset,
})

Execute the ranged attack using a component with animation

Implementation

void simpleAttackRangeByDirection({
  required Future<SpriteAnimation> animationRight,
  required Vector2 size,
  required Direction direction,
  required AttackFromEnum attackFrom,
  Vector2? destroySize,
  dynamic id,
  double speed = 150,
  double damage = 1,
  bool withCollision = true,
  bool enableDiagonal = true,
  VoidCallback? onDestroy,
  CollisionConfig? collision,
  LightingConfig? lightingConfig,
  Future<SpriteAnimation>? animationDestroy,
  double marginFromOrigin = 16,
  Vector2? centerOffset,
}) {
  simpleAttackRangeByAngle(
    angle: direction.toRadians(),
    animation: animationRight,
    attackFrom: attackFrom,
    damage: damage,
    size: size,
    animationDestroy: animationDestroy,
    centerOffset: centerOffset,
    marginFromOrigin: marginFromOrigin,
    collision: collision,
    destroySize: destroySize,
    id: id,
    lightingConfig: lightingConfig,
    onDestroy: onDestroy,
    speed: speed,
    withDecorationCollision: withCollision,
  );
}