Player constructor

Player({
  1. required Vector2 position,
  2. required Vector2 size,
  3. double life = 100,
  4. double? speed,
})

Implementation

Player({
  required Vector2 position,
  required Vector2 size,
  double life = 100,
  double? speed,
}) {
  this.speed = speed ?? this.speed;
  receivesAttackFrom = AcceptableAttackOriginEnum.ENEMY;
  initialLife(life);
  this.position = position;
  this.size = size;
}