To add a scoring system to the Pong game, we will need to create variables to keep track of the scores for each player, update the scores when the ball goes past the paddle, and display the scores on the screen. Here is an example of how the code can be modified to add a simple scoring system:

Python Code: 

# Define game variables
ball_pos_x = window_width/2
ball_pos_y = window_height/2
ball_radius = 10
ball_vel_x = 3
ball_vel_y = 3
player1_score = 0
player2_score = 0
font = pygame.font.SysFont(None, 48) # Create a font object for displaying the score

# Game loop
while True:
    # Handle events
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

    # Update positions
    ball_pos_x += ball_vel_x
    ball_pos_y += ball_vel_y

    # Check for collisions
    if ball_pos_x - ball_radius <= 0:
        ball_vel_x *= -1
        player2_score += 1
    elif ball_pos_x + ball_radius >= window_width:
        ball_vel_x *= -1
        player1_score += 1
    elif ball_pos_y - ball_radius <= 0 or ball_pos_y + ball_radius >= window_height:
        ball_vel_y *= -1

    # Draw the window
    window.fill(black)
    pygame.draw.circle(window, white, (int(ball_pos_x), int(ball_pos_y)), ball_radius)
    pygame.draw.rect(window, white, (paddle_1_pos_x, paddle_1_pos_y, paddle_width, paddle_height))
    pygame.draw.rect(window, white, (paddle_2_pos_x, paddle_2_pos_y, paddle_width, paddle_height))

    # Draw the score on the screen
    score_text = font.render(f"{player1_score} : {player2_score}", True, white)
    window.blit(score_text, (window_width/2 - score_text.get_width()/2, 20))
    pygame.display.update()

    # Delay to get 60 fps
    clock.tick(60)

In the modified code, we have added two new variables player1_score and player2_score to keep track of the scores for each player. We have also created a font object font to display the score on the screen.

We update the scores when the ball goes past the paddle by checking if the ball goes past the left or right edge of the screen. If the ball goes past the left edge, then player 2 scores a point, and if the ball goes past the right edge, then player 1 scores a point.

Finally, we draw the score on the screen using the render() method of the font object, and the blit() method of the window surface to display it on the screen.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence