FlyingAttackGameObject constructor
FlyingAttackGameObject({
- required Vector2 position,
- required Vector2 size,
- required FutureOr<
SpriteAnimation> ? animation, - double angle = 0,
- 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({
required super.position,
required super.size,
required super.animation,
super.angle = 0,
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;
_cosAngle = cos(angle);
_senAngle = sin(angle);
if (direction != null) {
moveFromDirection(direction!, enabledDiagonal: enabledDiagonal);
} else {
moveFromAngle(angle);
}
movementOnlyVisible = false;
}