title: Pong via Python Turtle issues
body: <p>I've been looking at this for hours and can't figure out why it won't run properly. Any ideas? I've tried messing with different x and y coords to see if that was the problem but nothing works.
  The program just runs twitches and ends, when it should be playing through a game of pong until the user exits out.</p>
  <p>code: you can ignore the comments</p>
  <pre><code>import turtle
  
  # screen
  screen = turtle.Screen()
  screen.title('Pong')
  screen.bgcolor('black')
  screen.setup(width=1000, height=500)
  
  # ball
  ball = turtle.Turtle()
  ball.shape('circle')
  ball.color('white')
  ball.speed(0)
  ball.penup()                                        #solves line issue
  ball.goto(0, 0)
  ball.dx = 5
  ball.dy = -5
  
  # right paddle____add speed___
  r_pad = turtle.Turtle()
  r_pad.speed(0.5)
  r_pad.shape('square')
  r_pad.color('white')
  r_pad.shapesize(stretch_wid=5, stretch_len=2)
  r_pad.penup()
  r_pad.goto(450, 0)
  
  # left paddle
  l_pad = turtle.Turtle()
  l_pad.speed(0.5)
  l_pad.shape('square')
  l_pad.color('white')
  l_pad.shapesize(stretch_wid=5, stretch_len=2)
  l_pad.penup()
  l_pad.goto(-450, 0)
  
  
  # Score
  score = turtle.Turtle()
  score.speed(0)
  score.color('white')
  score.penup()
  score.hideturtle()
  score.goto(0, 200)
  score.write(&quot;Left_player : 0 Right_player: 0&quot;,
               align=&quot;center&quot;, font=(&quot;arial&quot;, 24, &quot;normal&quot;))
  #solving that score error
  left_player = 0
  right_player = 0
  
  # movement
  def paddler_up():
      y = r_pad.ycor()
      y += 20
      r_pad.sety(y)
  
  
  def paddler_down():
      y = r_pad.ycor()
      y -= 20
      r_pad.sety(y)
  
  
  def paddlel_up():
      y = l_pad.ycor()
      y += 20
      l_pad.sety(y)
  
  
  def paddlel_down():
      y = l_pad.ycor()
      y -= 20
      l_pad.sety(y)
  
  
  
  #main game
  screen.listen()
  screen.onkeypress(paddler_up, &quot;w&quot;)
  screen.onkeypress(paddler_down, &quot;s&quot;)
  screen.onkeypress(paddlel_up, &quot;up&quot;)
  screen.onkeypress(paddlel_down, &quot;down&quot;)
  
  
  
  while True:
      screen.update()
  
      ball.setx(ball.xcor() + ball.dx)
      ball.sety(ball.ycor() + ball.dy)
  
      # Checking borders
      if ball.ycor() &gt; 230:
          ball.sety(230)
          ball.dy *= -1
  
      if ball.ycor() &lt; -230:
          ball.sety(-230)
          ball.dy *= -1
  
      if ball.xcor() &gt; 600:
          ball.goto(0, 0)
          ball.dy *= -1
          left_player += 1
          score.clear()
          score.write(&quot;Left_player : {} Right_player: {}&quot;.format(
              left_player, right_player), align=&quot;center&quot;,
              font=(&quot;Courier&quot;, 24, &quot;normal&quot;))
  
      if ball.xcor() &lt; -600:
          ball.goto(0, 0)
          ball.dy *= -1
          right_player += 1
          score.clear()
          score.write(&quot;Left_player : {} Right_player: {}&quot;.format(
              left_player, right_player), align=&quot;center&quot;,
              font=(&quot;Courier&quot;, 24, &quot;normal&quot;))
  
      # Paddle ball collision
      if (ball.xcor() &gt; 360 and ball.xcor() &lt; 370) \
              and (ball.ycor() &lt; r_pad.ycor() + 40 and ball.ycor() &gt; r_pad.ycor() - 40):
          ball.setx(360)
          ball.dx *= -1
  
      if (ball.xcor() &lt; -360 and ball.xcor() &gt; -370) \
              and (ball.ycor() &lt; l_pad.ycor() + 40 and ball.ycor() &gt; l_pad.ycor() - 40):
          ball.setx(-360)
          ball.dx *= -1
  </code></pre>