SpinePlayer constructor

SpinePlayer({
  1. required Vector2 position,
  2. required Vector2 size,
  3. required SkeletonAnimation skeleton,
  4. Direction initDirection = Direction.right,
  5. double speed = 150,
})

Implementation

SpinePlayer({
  required Vector2 position,
  required Vector2 size,
  required SkeletonAnimation skeleton,
  Direction initDirection = Direction.right,
  double speed = 150,
}) : super(
        position: position,
        size: size,
        speed: speed,
      ) {
  // this.speed = 150* (size.x/100);
  this.skeleton = skeleton;
  lastDirection = initDirection;
  if (initDirection == Direction.left || initDirection == Direction.right) {
    lastDirectionHorizontal = initDirection;
  }
  // setupLighting(
  //   // LightingConfig(
  //   //     radius: width * 1.5,
  //   //     blurBorder: width * 1.5,
  //   //     color: Colors.red
  //   // ),
  // );
  setupCollision(
    CollisionConfig(
      collisions: [
        CollisionArea.rectangle(
          size: Vector2(
            32,
            32,
          ),
          align: Vector2(
            size.x * 0.3,
            0,
          ),
        )
      ],
    ),
  );
}