moveWithAngle method

Particle moveWithAngle(
  1. double angle
)

Implementation

Particle moveWithAngle(double angle) {
  final next = this + Offset.fromDirection(angle, speed);

  final lifetime = life - 0.01;
  // final opacity = lifetime > 1 ? lifetime - 1 : lifetime;

  final color = lifetime > .1 ? this.color.withOpacity(lifetime.clamp(0, 1)) : this.color;

  return copyWith(
    dx: next.dx,
    dy: next.dy,
    life: lifetime,
    color: color,
    // Given angle
    angle: angle,
  );
}