reset method

void reset()

当雪花移出屏幕时,需要重置参数

Implementation

void reset() {
  double ratio = 1.0;
  double random = 0.4 + 0.12 * Random().nextDouble() * 5;
  scale = 1;
  speed = 8 *  Random().nextDouble();
  alpha = random;
  x = Random().nextInt(width! * 1.2 ~/ scale!).toDouble() -
      width! * 0.1 ~/ scale!;
}