{"size": 438, "ext": "js", "max_stars_repo_path": "src/core/colliders/BoxColider.js", "max_stars_repo_name": "maximbircu/ping-pong-game", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/core/colliders/BoxColider.js", "max_issues_repo_name": "maximbircu/ping-pong-game", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/core/colliders/BoxColider.js", "max_forks_repo_name": "maximbircu/ping-pong-game", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.6923076923, "max_line_length": 88, "alphanum_fraction": 0.598173516}
export class BoxCollider {
    static collides(object1, object2) {
        return this.collidesTest(
            object1.x, object1.y, object1.boundingBox.width, object1.boundingBox.height,
            object2.x, object2.y, object2.boundingBox.width, object2.boundingBox.height,
        )
    }

    static collidesTest(ax, ay, aw, ah, bx, by, bw, bh) {
        return ax < bx + bw && ay < by + bh && bx < ax + aw && by < ay + ah
    }
}
