simpleAttackMelee method
void
simpleAttackMelee({})
Execute simple attack melee using animation
Implementation
void simpleAttackMelee({
required double damage,
required Vector2 size,
int? id,
int interval = 1000,
bool withPush = false,
double? sizePush,
Direction? direction,
Future<SpriteAnimation>? animationRight,
VoidCallback? execute,
Vector2? centerOffset,
}) {
if (!checkInterval('attackMelee', interval, dtUpdate)) return;
if (isDead) return;
Direction direct = direction ?? lastDirection;
simpleAttackMeleeByDirection(
damage: damage,
direction: direct,
size: size,
id: id,
withPush: withPush,
sizePush: sizePush,
animationRight: animationRight,
attackFrom: AttackOriginEnum.PLAYER_OR_ALLY,
centerOffset: centerOffset,
);
execute?.call();
}