CreateJs

collision: detect the width / height and X / Y position:

function isCollide(a, b) {
return !(
    ((a.y + a.height) < (b.y)) ||
    (a.y > (b.y + b.height)) ||
    ((a.x + a.width) < b.x) ||
    (a.x > (b.x + b.width))
    );
}

For LCC MA.IVM Reflective Journal
/ Home / Archives / Heyao.art

Made by Heyao / Site by HEXO