Advertisement
Rynoxx

Untitled

Oct 25th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jrpg.findIn = function(needle, haystack){
  2.     if(
  3.         ((haystack.x + haystack.w >= needle.x && haystack.x <= needle.x + needle.w) &&
  4.         (haystack.y <= needle.y + needle.h && haystack.y + haystack.h >= needle.y)) ||
  5.         ((haystack.x + haystack.w >= needle.x && haystack.x <= needle.x + needle.w) &&
  6.         (haystack.y + haystack.h <= needle.y + needle.h && haystack.y >= needle.y + needle.h)) ||
  7.         ((haystack.x >= needle.x + needle.w && haystack.x + haystack.w <= needle.x + needle.w) &&
  8.         (haystack.y <= needle.y + needle.h && haystack.y + haystack.h >= needle.y)) ||
  9.         ((haystack.x >= needle.x && haystack.x + haystack.w <= needle.x + needle.w) &&
  10.         (haystack.y + haystack.h <= needle.y + needle.h && haystack.y >= needle.y + needle.h))
  11.         ){
  12.         return true;
  13.     }
  14.  
  15.     return false;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement