Skip to content

Instantly share code, notes, and snippets.

@marisusis
Last active May 6, 2016 17:02
Show Gist options
  • Save marisusis/1e844c97e7353af381de227b7455c538 to your computer and use it in GitHub Desktop.
Save marisusis/1e844c97e7353af381de227b7455c538 to your computer and use it in GitHub Desktop.
function colCheck(a,b) {
var acx = a.w/2 + a.x,
acy = a.h/2 + a.y,
bcx = b.w/2 + b.x,
bcy = b.h/2 + b.y;
var w = (a.w + b.w)/2,
h = (a.h + b.h)/2,
dx = (acx - bcx),
dy = (acy - bcy);
if (a.w >= b.w) {
return 'yes';
} else {
return 'not';
}
}
var obja = {x:0,y:0,w:20,h:30},
objb = {x:20,y:38,w:20,y:20};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment