Skip to content

Commit

Permalink
Make isColliding return false if edges overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
maryrosecook committed Aug 22, 2014
1 parent e134dc2 commit 2c9a822
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions space-invaders/space-invaders.js
Expand Up @@ -194,10 +194,10 @@
var isColliding = function(b1, b2) {
return !(
b1 === b2 ||
b1.center.x + b1.size.x / 2 < b2.center.x - b2.size.x / 2 ||
b1.center.y + b1.size.y / 2 < b2.center.y - b2.size.y / 2 ||
b1.center.x - b1.size.x / 2 > b2.center.x + b2.size.x / 2 ||
b1.center.y - b1.size.y / 2 > b2.center.y + b2.size.y / 2
b1.center.x + b1.size.x / 2 <= b2.center.x - b2.size.x / 2 ||
b1.center.y + b1.size.y / 2 <= b2.center.y - b2.size.y / 2 ||
b1.center.x - b1.size.x / 2 >= b2.center.x + b2.size.x / 2 ||
b1.center.y - b1.size.y / 2 >= b2.center.y + b2.size.y / 2
);
};

Expand Down

0 comments on commit 2c9a822

Please sign in to comment.