DamageHitbox constructor
DamageHitbox({
- dynamic id,
- required Vector2 position,
- required double damage,
- required AttackOriginEnum origin,
- required Vector2 size,
- double angle = 0,
- void onDamage(
- Attackable attackable
- Anchor anchor = Anchor.center,
- Duration damageInterval = const Duration(seconds: 1),
- 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;
}