Hi im making a platformer in javascript and this is the collision function that I have
if(obj2.y > obj1.y + obj1.height ||
obj2.y + obj2.height < obj1.y||
obj2.x > obj1.x + obj1.width ||
obj2.x + obj2.width < obj1.x){
return false;
} else {
return true;
}
so my question is how do I tell which side obj1 is colliding with obj2?.