Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def collide(a, b):
  2. left_a, bottom_a, right_a, top_a = a.get_bb()
  3. left_b, bottom_b, right_b, top_b = b.get_bb()
  4.  
  5. #if left_a > right_b : return False
  6. #if right_a < left_b : return False
  7. #if top_a < bottom_b : return False
  8. #if bottom_a > top_b : return False
  9.  
  10.  
  11. if right_a < left_b or left_a > right_b:
  12. return False
  13. elif top_a < bottom_b or bottom_a > top_b:
  14. return False
  15.  
  16. #print "Collide! %s %s" % (a, b)
  17.  
  18. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement