simpleAttackMeleeByDirection method
void
simpleAttackMeleeByDirection({
- Future<
SpriteAnimation> ? animationRight, - dynamic id,
- required double damage,
- required Direction direction,
- required Vector2 size,
- required AttackOriginEnum attackFrom,
- bool withPush = true,
- double? sizePush,
- double? marginFromCenter,
- Vector2? centerOffset,
- void onDamage(
- Attackable attackable
Execute simple attack melee using animation
Implementation
void simpleAttackMeleeByDirection({
Future<SpriteAnimation>? animationRight,
dynamic id,
required double damage,
required Direction direction,
required Vector2 size,
required AttackOriginEnum attackFrom,
bool withPush = true,
double? sizePush,
double? marginFromCenter,
Vector2? centerOffset,
void Function(Attackable attackable)? onDamage,
}) {
final rect = rectCollision;
simpleAttackMeleeByAngle(
angle: direction.toRadians(),
animation: animationRight,
attackFrom: attackFrom,
damage: damage,
size: size,
centerOffset: centerOffset,
marginFromCenter: marginFromCenter ?? max(rect.width, rect.height) / 2,
id: id,
withPush: withPush,
onDamage: onDamage,
);
}