public static boolean checkIntersection(Square square1, Square square2){
        if(square1.containsPoint(square2.getX()+1, square2.getY()+1) ||
                square1.containsPoint(square2.getX()+1, square2.getY() + square2.getHeight() -1) ||
                square1.containsPoint(square2.getX() + square2.getWidth() -1, square2.getY() + square2.getHeight() -1) ||
                square1.containsPoint(square2.getX() + square2.getWidth() -1, square2.getY()+1)){
            return true;
        }

        return false;
    }