79711169

Date: 2025-07-23 00:20:44
Score: 1
Natty:
Report link

So, what I needed to do is calculate if the y of the collision point is greater than the y coordinate of the bottom of the paddle and the collision point is lesser than the y coords of the top of the paddle: Here is the code to do that:

if paddle.ycor() - 10 < ball.ycor() + 10 < paddle.ycor() + 10:
    speed_x *= -1
else:
    speed_y *= -1

paddle.ycor() - 10 is the bottom of the paddle and paddle.ycor() + 10 the top and the ball y coords in greater than the common and less than the top

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Aadvik