SimplePlayer constructor

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

Implementation

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