10 - Adding the Walls/script.js
//collision detection between ball and wall

collision detection between ball and wall
collision detection between ball and wall
function coll_det_bw(b1, w1){
    let ballToClosest = closestPointBW(b1, w1).subtr(b1.pos);
    if (ballToClosest.mag() <= b1.r){
        return true;
    }
}
function coll_det_bw ( b1 , w1 ) { let ballToClosest = closestPointBW ( b1 , w1 ) . subtr ( b1 . pos ) ; if ( ballToClosest . mag ( ) <= b1 . r ) { return true ; } }
collision detection between ball and wall
collision detection between ball and wall