simpleAttackRange method

void simpleAttackRange({
  1. required Future<SpriteAnimation> animationRight,
  2. Future<SpriteAnimation>? animationDestroy,
  3. required Vector2 size,
  4. Vector2? destroySize,
  5. dynamic id,
  6. double speed = 150,
  7. double damage = 1,
  8. Direction? direction,
  9. bool withCollision = true,
  10. bool diagonalEnabled = true,
  11. VoidCallback? onDestroy,
  12. ShapeHitbox? collision,
  13. LightingConfig? lightingConfig,
})

Implementation

void simpleAttackRange({
  required Future<SpriteAnimation> animationRight,
  Future<SpriteAnimation>? animationDestroy,
  required Vector2 size,
  Vector2? destroySize,
  dynamic id,
  double speed = 150,
  double damage = 1,
  Direction? direction,
  bool withCollision = true,
  bool diagonalEnabled = true,
  VoidCallback? onDestroy,
  ShapeHitbox? collision,
  LightingConfig? lightingConfig,
}) {
  Direction attackDirection = direction ?? _getLastDirection(diagonalEnabled);
  simpleAttackRangeByDirection(
    direction: attackDirection,
    animationRight: animationRight,
    animationDestroy: animationDestroy,
    size: size,
    id: id,
    speed: speed,
    damage: damage,
    withCollision: withCollision,
    onDestroy: onDestroy,
    destroySize: destroySize,
    collision: collision,
    lightingConfig: lightingConfig,
    attackFrom: AttackOriginEnum.PLAYER_OR_ALLY,
  );
}