public boolean collision(double x1, double y1, double x2, double y2, int imgW2, int imgH2){
        if(x1 > x2 && x1 < x2 + imgW2){
            if(y1 > y2 && y1 < y2 + imgH2){
            return false;
            } 
        }else if(x1 < x2 && x1 > x2 - imgW2){
            if(y1 < y2 && y1 > y2 - imgH2){
            return false;
            } 
        }
        return true;
    }