SimpleNpc constructor

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

Implementation

SimpleNpc({
  required Vector2 position,
  required Vector2 size,
  SimpleDirectionAnimation? animation,
  double? speed,
  Direction initDirection = Direction.right,
}) : super(
        position: position,
        size: size,
        speed: speed,
      ) {
  this.animation = animation;
  lastDirection = initDirection;
  lastDirectionHorizontal =
      initDirection == Direction.left ? Direction.left : Direction.right;
}