public void move(Rectangle2D bounds){
        x += dx;
        y += dy;
        if(x < bounds.getMinX()){
            x = bounds.getMinX();
            dx = -dx;
        }

        if(x + XSIZE > bounds.getMaxX()){
            x = bounds.getMaxX() - XSIZE;
            dx = -dx;
        }

        if(y < bounds.getMinY()){
            y = bounds.getMinY();
            dy = -dy;
        }

        if(y + YSIZE >= bounds.getMaxY()){
            y = bounds.getMaxY() - YSIZE;
            dy = -dy;
        }

    }