SimpleEnemy constructor

SimpleEnemy({
  1. required Vector2 position,
  2. required Vector2 size,
  3. SimpleDirectionAnimation? animation,
  4. double life = 100,
  5. double speed = 100,
  6. Direction initDirection = Direction.right,
  7. ReceivesAttackFromEnum receivesAttackFrom = ReceivesAttackFromEnum.PLAYER_AND_ALLY,
})

Implementation

SimpleEnemy({
  required Vector2 position,
  required Vector2 size,
  SimpleDirectionAnimation? animation,
  double life = 100,
  double speed = 100,
  Direction initDirection = Direction.right,
  ReceivesAttackFromEnum receivesAttackFrom =
      ReceivesAttackFromEnum.PLAYER_AND_ALLY,
}) : super(
        position: position,
        size: size,
        life: life,
        speed: speed,
        receivesAttackFrom: receivesAttackFrom,
      ) {
  this.animation = animation;
  lastDirection = initDirection;
  lastDirectionHorizontal =
      initDirection == Direction.left ? Direction.left : Direction.right;
}