update method

void update(
  1. Random random,
  2. double speed,
  3. double width,
  4. double height,
  5. double rotationSpeed,
)

Implementation

void update(
  Random random,
  double speed,
  double width,
  double height,
  double rotationSpeed,
) {
  z -= speed;
  rotation += rotationSpeed;
  if (z < 1) {
    z = width;
    x = random.nextDouble() * width * 2 - width;
    y = random.nextDouble() * height * 2 - height;
    pz = z;
  }
}