[engine] remove tank grid align

This commit is contained in:
2018-01-16 21:59:11 +03:00
parent f5de852727
commit b3dfc42f0b
3 changed files with 11 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ class Rectangle {
}
public function contain(point:Point):Bool {
return point.x >= x && point.y >= y && point.x <= width && point.y <= height;
return point.x >= left && point.y >= top && point.x <= right && point.y <= bottom;
}
public function intersection(rect:Rectangle):Bool {
@@ -72,6 +72,10 @@ class Rectangle {
rect.bottom < top);
}
public function intersection2(line:Line):Bool {
return contain(line.point1) || contain(line.point2);
}
public function lean(rect:Rectangle):Void {
var side = rect.getSide(direction);
if (direction.x != 0) {