simpleAttackRangeByDirection method

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