FlyingAttackGameObject.byDirection constructor
FlyingAttackGameObject.byDirection({
- required Vector2 position,
- required Vector2 size,
- required FutureOr<
SpriteAnimation> ? animation, - required Direction? direction,
- dynamic id,
- Future<
SpriteAnimation> ? animationDestroy, - Vector2? destroySize,
- double speed = 150,
- double damage = 1,
- AttackOriginEnum attackFrom = AttackOriginEnum.ENEMY,
- bool withDecorationCollision = true,
- VoidCallback? onDestroy,
- bool enabledDiagonal = true,
- LightingConfig? lightingConfig,
- ShapeHitbox? collision,
Implementation
FlyingAttackGameObject.byDirection({
required super.position,
required super.size,
required super.animation,
required this.direction,
this.id,
this.animationDestroy,
this.destroySize,
double speed = 150,
this.damage = 1,
this.attackFrom = AttackOriginEnum.ENEMY,
this.withDecorationCollision = true,
this.onDestroy,
this.enabledDiagonal = true,
super.lightingConfig,
this.collision,
}) {
this.speed = speed;
moveFromDirection(direction!, enabledDiagonal: enabledDiagonal);
movementOnlyVisible = false;
}