public void update() {
        double cx = maxwidth / 2, cy = maxheight / 2;
        double dist = Math.sqrt(((cx - rect.x) * (cx - rect.x)) +
                                ((cy - rect.y) * (cy - rect.y)));

        rect.x += xvel;
        rect.y += yvel;
        xvel = (rect.x - cx) / 50;
        yvel = (rect.y - cy) / 50;
        rect.width += zvel / 3;
        rect.height = rect.width;
        zvel = dist * dist / 700000;

        if (rect.x <= 0 || rect.y <= 0 || rect.x >= maxwidth || rect.y >= maxheight) {
            reset();
            show = true;
        }
    }