reset method

void reset()

Implementation

void reset() {
  final random = Random();
  x = random.nextDouble() * screenSize.width;
  y = random.nextDouble() * screenSize.height;
  size = random.nextDouble() * 10 + 5; // Random size
  speed = random.nextDouble() * 2 + 1; // Slow falling speed
  angle = random.nextDouble() * pi / 4 -
      pi / 8; // Horizontal sway (-22.5 to 22.5 degrees)
  paint = Paint()
    ..color = colors[Random().nextInt(colors.length)]
    ..style = PaintingStyle.fill;
}