SimplePlayer constructor

SimplePlayer({
  1. required Vector2 position,
  2. required Vector2 size,
  3. SimpleDirectionAnimation? animation,
  4. Direction initDirection = Direction.right,
  5. double speed = 150,
  6. double life = 100,
})

Implementation

SimplePlayer({
  required Vector2 position,
  required Vector2 size,
  SimpleDirectionAnimation? animation,
  Direction initDirection = Direction.right,
  double speed = 150,
  double life = 100,
}) : super(
        position: position,
        size: size,
        life: life,
        speed: speed,
      ) {
  this.animation = animation;
  lastDirection = initDirection;
  if (initDirection == Direction.left || initDirection == Direction.right) {
    lastDirectionHorizontal = initDirection;
  }
}