DamageHitbox constructor

DamageHitbox({
  1. dynamic id,
  2. required Vector2 position,
  3. required double damage,
  4. required AttackOriginEnum origin,
  5. required Vector2 size,
  6. double angle = 0,
  7. void onDamage(
    1. Attackable attackable
    )?,
  8. Anchor anchor = Anchor.center,
  9. Duration damageInterval = const Duration(seconds: 1),
  10. Duration duration = const Duration(milliseconds: 200),
})

Implementation

DamageHitbox({
  this.id,
  required Vector2 position,
  required this.damage,
  required this.origin,
  required Vector2 size,
  double angle = 0,
  this.onDamage,
  Anchor anchor = Anchor.center,
  this.damageInterval = const Duration(seconds: 1),
  this.duration = const Duration(milliseconds: 200),
}) {
  this.angle = angle;
  this.anchor = anchor;
  this.size = size;
  this.position = position;
}