@Override
  public void update(double deltaSec, double scrollDistance)
  { alpha -= .02;
    if (alpha <= 0 || !gmass.isAlive()) die(false);
    this.scrollDistance = scrollDistance;

    if(player != null)
    { gmass.setX(Library.worldUnitToScreen(player.getCenterX()));
      gmass.setY(Library.worldPosYToScreen(player.getCenterY()));
    }

    double xpull = gmass.getXpull();
    double ypull = gmass.getYpull();
    double dx, dy;
    for(Particle p: particles){
      dx = gmass.getX() - p.getX();
      dy = gmass.getY() - p.getY();
      double distance = Math.sqrt(dx * dx + dy * dy);
      double mag = 1/distance;
      if(player != null && distance > 10){
        p.update(xpull * dx * mag * Library.RANDOM.nextDouble(), ypull * dy * mag * Library.RANDOM.nextDouble());
      }
      else if(player == null){
        p.update(xpull * dx * mag * Library.RANDOM.nextDouble(), ypull * dy * mag * Library.RANDOM.nextDouble());
      }

    }
  }