Player constructor

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

Implementation

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