, - box collision.
, , , DIV. , .
--.
function intersects(a,b)
{
if(a.x + a.w > b.x)
sectHor = true;
if(a.x < b.x + b.w)
sectHor = true;
if(a.y < b.y + b.h)
sectVert = true;
if(a.y + a.h > b.y)
sectVert = true;
if(sectHor && sectVert)
return true;
else return false;
}
, , , , , , . , , - A B . , , , .