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