fn ball_hits_player(player: na::Point2<f32>, ball: na::Point2<f32>) -> bool {
    if ball.x - BALL_SIZE_HALF < player.x + RACKET_WIDTH_HALF
        && ball.x + BALL_SIZE_HALF > player.x - RACKET_WIDTH_HALF
        && ball.y - BALL_SIZE_HALF < player.y + RACKET_HEIGHT_HALF
        && ball.y + BALL_SIZE_HALF > player.y - RACKET_HEIGHT_HALF
    {
        return true;
    }
    false
}
// If the ball and a racket collides, then return true
If the ball and a racket collides, then return true
If the ball and a racket collides then return true
fn ball_hits_player(player: na::Point2<f32>, ball: na::Point2<f32>) -> bool {
    if ball.x - BALL_SIZE_HALF < player.x + RACKET_WIDTH_HALF
        && ball.x + BALL_SIZE_HALF > player.x - RACKET_WIDTH_HALF
        && ball.y - BALL_SIZE_HALF < player.y + RACKET_HEIGHT_HALF
        && ball.y + BALL_SIZE_HALF > player.y - RACKET_HEIGHT_HALF
    {
        return true;
    }
    false
}
fn ball_hits_player ( player : na :: Point2 < f32 > , ball : na :: Point2 < f32 > ) -> bool { if ball . x - BALL_SIZE_HALF < player . x + RACKET_WIDTH_HALF && ball . x + BALL_SIZE_HALF > player . x - RACKET_WIDTH_HALF && ball . y - BALL_SIZE_HALF < player . y + RACKET_HEIGHT_HALF && ball . y + BALL_SIZE_HALF > player . y - RACKET_HEIGHT_HALF { return true ; } false }
If the ball and a racket collides, then return true
If the ball and a racket collides then return true
player
na::Point2<f32>
ball
na::Point2<f32>
player
na::Point2<f32>
ball
na::Point2<f32>