Thread: Box Checks
View Single Post
  #10  
Old 05-16-2010, 11:13 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Forgot to post this, but if anyone is wondering what I've done for this, I've posted it below.

PHP Code:
function checkCollision(firstxfirstyfirstwfirsthsecondxsecondysecondwsecondh) {
  if ((
firstx <= secondx && firstx+firstw >= secondx+secondw) || (firstx >= secondx && firstx+firstw <= secondx+secondw) || (firstx <= secondx && firstx+firstw >= secondx) || (firstx <= secondx+secondw && firstx+firstw >= secondx+secondw)) {
    if ((
firsty <= secondy && firsty+firsth >= secondy+secondh) || (firsty >= secondy && firsty+firsth <= secondy+secondh) || (firsty <= secondy && firsty+firsth >= secondy) || (firsty <= secondy+secondh && firsty+firsth >= secondy+secondh)) {
      return 
true;
    }
  }

__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote