SimpleEnemy constructor

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

Implementation

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