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