update method

  1. @override
void update()
override

Implementation

@override
void update() {
  if (lifeSpan > 0) {
    x += speed * cos(angle); // Move in the x-direction
    y += speed * sin(angle); // Move in the y-direction
    speed *= 0.97; // Gradual deceleration
    radius *= 0.98; // Shrink the particle over time
    lifeSpan -= 0.03; // Reduce life span
  }
}