simpleAttackRange method

void simpleAttackRange({
  1. required Future<SpriteAnimation> animation,
  2. required Vector2 size,
  3. Future<SpriteAnimation>? animationDestroy,
  4. Vector2? destroySize,
  5. dynamic id,
  6. double speed = 150,
  7. double damage = 1,
  8. double? radAngleDirection,
  9. bool withDecorationCollision = true,
  10. VoidCallback? onDestroy,
  11. ShapeHitbox? collision,
  12. LightingConfig? lightingConfig,
  13. Vector2? centerOffset,
  14. double marginFromOrigin = 16,
})

Implementation

void simpleAttackRange({
  /// use animation facing right.
  required Future<SpriteAnimation> animation,
  required Vector2 size,
  Future<SpriteAnimation>? animationDestroy,
  Vector2? destroySize,
  dynamic id,
  double speed = 150,
  double damage = 1,
  double? radAngleDirection,
  bool withDecorationCollision = true,
  VoidCallback? onDestroy,
  ShapeHitbox? collision,
  LightingConfig? lightingConfig,
  Vector2? centerOffset,
  double marginFromOrigin = 16,
}) {
  double? angle = radAngleDirection ?? this.angle;

  simpleAttackRangeByAngle(
    angle: angle,
    animation: animation,
    animationDestroy: animationDestroy,
    size: size,
    id: id,
    speed: speed,
    damage: damage,
    withDecorationCollision: withDecorationCollision,
    onDestroy: onDestroy,
    destroySize: destroySize,
    collision: collision,
    lightingConfig: lightingConfig,
    centerOffset: centerOffset,
    marginFromOrigin: marginFromOrigin,
    attackFrom: AttackOriginEnum.PLAYER_OR_ALLY,
  );
}