hardshell=3
if ( ( Math.abs(x1+w1/2-(x2+w2/2)) < hardshell * (w2+w1)/2 ) && ( Math.abs(y1+h1/2-(y2+h2/2)) < hardshell * (h2+h1)/2 ) )