simpleAttackMelee method

void simpleAttackMelee({
  1. required Future<SpriteAnimation> animation,
  2. required double damage,
  3. required Vector2 size,
  4. dynamic id,
  5. double? radAngleDirection,
  6. bool withPush = true,
  7. double marginFromCenter = 16,
  8. Vector2? centerOffset,
})

Implementation

void simpleAttackMelee({
  /// use animation facing right.
  required Future<SpriteAnimation> animation,
  required double damage,
  required Vector2 size,
  dynamic id,
  double? radAngleDirection,
  bool withPush = true,
  double marginFromCenter = 16,
  Vector2? centerOffset,
}) {
  double? angle = radAngleDirection ?? this.angle;
  simpleAttackMeleeByAngle(
    angle: angle,
    animation: animation,
    damage: damage,
    id: id,
    size: size,
    withPush: withPush,
    marginFromCenter: marginFromCenter,
    centerOffset: centerOffset,
    attackFrom: AttackOriginEnum.PLAYER_OR_ALLY,
  );
}