Code Pong in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 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 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน

      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 3 หลายเดือนก่อน

    hi