Enemy constructor

Enemy({
  1. required Vector2 position,
  2. required Vector2 size,
  3. double life = 10,
  4. double speed = 100,
  5. ReceivesAttackFromEnum receivesAttackFrom = ReceivesAttackFromEnum.PLAYER_AND_ALLY,
})

Implementation

Enemy({
  required Vector2 position,
  required Vector2 size,
  double life = 10,
  double speed = 100,
  ReceivesAttackFromEnum receivesAttackFrom =
      ReceivesAttackFromEnum.PLAYER_AND_ALLY,
}) : super(position: position, size: size, speed: speed) {
  this.speed = speed;
  this.receivesAttackFrom = receivesAttackFrom;
  initialLife(life);
  this.position = position;
  this.size = size;
}