Code Pong in Python

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024
  • Creating a classic Pong game using Python. From setting up the game environment to coding the paddle and ball movements, I cover each step by adding comment by every line explaining what it does .

Комментарии • 3

  • @sandeshbhantana2099
    @sandeshbhantana2099 2 месяца назад

    At 6:17 what is the if statement doing? I'm so confused ! what are you trying to do with the statement
    ``` if left_paddle.y < ball.y < left_paddle.y + left_paddle.height:```

    • @scriptsonneteer
      @scriptsonneteer  2 месяца назад

      lets say the ball is zipping across the screen, heading left. We need to figure out if it's going to smack into that left paddle. (ball.x_vel < 0) checks if its moving left. (left_paddle.y < ball.y < left_paddle.y + left_paddle.height) checks if its moving verticaly and (ball.x - ball.radius

  • @TheAnimationNerd
    @TheAnimationNerd 2 месяца назад

    hi