isCollision(point) {
            let x = point.x;
            let y = point.y;
            let halfWidth = this.width / 2;
            let minX = this.pos.x - halfWidth;
            let minY = this.pos.y - halfWidth;
            let maxX = this.pos.x + halfWidth;
            let maxY = this.pos.y + halfWidth;
            
            if(x >= minX && x <= maxX && y >= minY && y <= maxY) {
                let deltaMinX = Math.abs(x - minX);
                let deltaMaxX = Math.abs(x - maxX);
                let deltaMinY = Math.abs(y - minY);
                let deltaMaxY = Math.abs(y - maxY);
                let closest = min4(deltaMinX, deltaMaxX, deltaMinY, deltaMaxY);
                
                if(closest === 0 || closest === 1) {
                    return 1;
                } else {
                    return 2
                }
            }
        }
// return 1 if horizontal border, 2 if vertical border - both are truthy
return 1 if horizontal border, 2 if vertical border - both are truthy
return 1 if horizontal border 2 if vertical border - both are truthy
isCollision(point) {
            let x = point.x;
            let y = point.y;
            let halfWidth = this.width / 2;
            let minX = this.pos.x - halfWidth;
            let minY = this.pos.y - halfWidth;
            let maxX = this.pos.x + halfWidth;
            let maxY = this.pos.y + halfWidth;
            if(x >= minX && x <= maxX && y >= minY && y <= maxY) {
                let deltaMinX = Math.abs(x - minX);
                let deltaMaxX = Math.abs(x - maxX);
                let deltaMinY = Math.abs(y - minY);
                let deltaMaxY = Math.abs(y - maxY);
                let closest = min4(deltaMinX, deltaMaxX, deltaMinY, deltaMaxY);
                if(closest === 0 || closest === 1) {
                    return 1;
                } else {
                    return 2
                }
            }
        }
isCollision ( point ) { let x = point . x ; let y = point . y ; let halfWidth = this . width / 2 ; let minX = this . pos . x - halfWidth ; let minY = this . pos . y - halfWidth ; let maxX = this . pos . x + halfWidth ; let maxY = this . pos . y + halfWidth ; if ( x >= minX && x <= maxX && y >= minY && y <= maxY ) { let deltaMinX = Math . abs ( x - minX ) ; let deltaMaxX = Math . abs ( x - maxX ) ; let deltaMinY = Math . abs ( y - minY ) ; let deltaMaxY = Math . abs ( y - maxY ) ; let closest = min4 ( deltaMinX , deltaMaxX , deltaMinY , deltaMaxY ) ; if ( closest === 0 || closest === 1 ) { return 1 ; } else { return 2 } } }
return 1 if horizontal border, 2 if vertical border - both are truthy
return 1 if horizontal border 2 if vertical border - both are truthy