simpleAttackRangeByDirection method
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,
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,
);
}