RotationEnemy constructor

RotationEnemy({
  1. required Vector2 position,
  2. required Vector2 size,
  3. required Future<SpriteAnimation> animIdle,
  4. required Future<SpriteAnimation> animRun,
  5. double currentRadAngle = -1.55,
  6. double? speed,
  7. double life = 100,
  8. AcceptableAttackOriginEnum receivesAttackFrom = AcceptableAttackOriginEnum.PLAYER_AND_ALLY,
})

Implementation

RotationEnemy({
  required Vector2 position,
  required Vector2 size,
  required Future<SpriteAnimation> animIdle,
  required Future<SpriteAnimation> animRun,
  double currentRadAngle = -1.55,
  double? speed,
  double life = 100,
  AcceptableAttackOriginEnum receivesAttackFrom =
      AcceptableAttackOriginEnum.PLAYER_AND_ALLY,
}) : super(
        position: position,
        size: size,
        life: life,
        speed: speed,
        receivesAttackFrom: receivesAttackFrom,
      ) {
  angle = currentRadAngle;
  loader?.add(AssetToLoad(animIdle, (value) {
    this.animIdle = value;
  }));
  loader?.add(AssetToLoad(animRun, (value) {
    this.animRun = value;
  }));
}