title: How to make ball bounce off paddle
body: <pre><code>import pygame
  
  BLACK = pygame.color.Color('Black')
  YELLOW = pygame.color.Color('Yellow')
  BLUE = pygame.color.Color('Blue')
  
  pygame.init()
  screen = pygame.display.set_mode([700,500])
  screen_rect = screen.get_rect()
  
  pygame.display.set_caption("Trial to make PONG")
  
  blue_rect = pygame.Rect(10, 250, 20, 60)
  yellow_rect = pygame.Rect(670, 250, 20, 60)
  ball_rect = pygame.Rect(50, 50, 50, 50)
  
  ball_x_speed = 5
  ball_y_speed = 5
  
  clock = pygame.time.Clock()
  
  done = False
  while not done:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              done = True
  
      # check all pressed keys and move the paddles
      pressed = pygame.key.get_pressed()
      if pressed[pygame.K_UP]: blue_rect.move_ip(0, -5)
      if pressed[pygame.K_DOWN]: blue_rect.move_ip(0, 5)
      if pressed[pygame.K_w]: yellow_rect.move_ip(0, -5)
      if pressed[pygame.K_s]: yellow_rect.move_ip(0, 5)
  
      # ensure paddles stay on screen
      blue_rect.clamp_ip(screen_rect)
      yellow_rect.clamp_ip(screen_rect)
  
      # move the ball
      ball_rect.move_ip(ball_x_speed, ball_y_speed)
  
      # check if the ball needs to change direction
      if ball_rect.x  + ball_rect.width &gt; screen_rect.width or ball_rect.x &lt; 0:
          ball_x_speed = ball_x_speed * -1
      if ball_rect.y  + ball_rect.height&gt; screen_rect.height or ball_rect.y &lt; 0:
          ball_y_speed = ball_y_speed * -1
  
  
      # draw everything
      screen.fill(BLACK)
      pygame.draw.ellipse(screen, BLUE, ball_rect)
      pygame.draw.rect(screen,BLUE, blue_rect)
      pygame.draw.rect(screen,YELLOW, yellow_rect)
      pygame.display.flip()
      clock.tick(60)
  
  pygame.quit()
  </code></pre>
  
  <p>I have two paddles in the game and a ball is bouncing around. I tried making a collide point when the ball hit's the paddle. Im trying to recreate pong. The collide point didn't work (maybe because I didn't structure it right). </p>
  
  <p>I was wondering how can I make a collide point between the paddle (rectangle Blue and Yellow) and the ball (<code>ball_rect</code>) so that the ball bounces off the paddle?</p>