About to start re-doing collideShapes

This commit is contained in:
Richard Davey
2013-05-30 23:03:56 +01:00
parent 498725c078
commit 3e53c0671d
16 changed files with 1477 additions and 322 deletions
-11
View File
@@ -176,18 +176,7 @@ module Phaser {
* @return {Boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false.
**/
static intersects(a: Rectangle, b: Rectangle, tolerance?: number = 0): bool {
// ?
//return (a.right > b.x) && (a.x < b.right) && (a.bottom > b.y) && (a.y < b.bottom);
return !(a.left > b.right + tolerance || a.right < b.left - tolerance || a.top > b.bottom + tolerance || a.bottom < b.top - tolerance);
//if (a.x >= b.right || a.right <= b.x || a.bottom <= b.y || a.y >= b.bottom)
//{
// return false;
//}
//return true;
}
/**