title: Why does my pong game freeze after the ball hits the bottom and it doesn't display the "Game Over" screen?
body: <p>I am a high school student and also a python enthusiast. I am trying to make a pong game in python and most of it worked but I am trying to make the program wait 3 seconds before the ball starts moving and when the ball hits the bottom the program just freezes and it doesn't display the "Game Over" screen. Would anyone be able to help me with this? Here is the code I am working on.</p>
  
  <pre><code> from tkinter import *
   import random
   import time
  
   class Ball:
       def __init__(self, canvas, color, size, paddle):
           self.canvas = canvas
           self.paddle = paddle
           self.id = canvas.create_oval(15, 15, size, size, fill=color)
           self.canvas.move(self.id, 245, 100)
           self.xspeed = random.randrange(-3,3)
           self.yspeed = -1
           self.hit_bottom = False
           self.score = 0
  
       def draw(self):
           self.canvas.move(self.id, self.xspeed, self.yspeed)
           pos = self.canvas.coords(self.id)
           if pos[1] &lt;= 0:
               self.yspeed = 9
           if pos[3] &gt;= 400:
               self.hit_bottom = True
           if pos[0] &lt;= 0:
               self.xspeed = 9
           if pos[2] &gt;= 500:
               self.xspeed = -9
           if self.hit_paddle(pos) == True:
               self.yspeed = -9
               self.xspeed = random.randrange(-3,3)
               self.score += 1
  
      def hit_paddle(self, pos):
          paddle_pos = self.canvas.coords(self.paddle.id)
          if pos[2] &gt;= paddle_pos[0] and pos[0] &lt;= paddle_pos[2]:
              if pos[3] &gt;= paddle_pos[1] and pos[3] &lt;= paddle_pos[3]:
                  return True
          return False
  
  class Paddle:
      def __init__(self, canvas, color):
          self.canvas = canvas
          self.id = canvas.create_rectangle(0,0, 168, 20, fill=color)
          self.canvas.move(self.id, 200, 300)
          self.xspeed = 0
          self.canvas.bind_all('&lt;KeyPress-Left&gt;', self.move_left)
          self.canvas.bind_all('&lt;KeyPress-Right&gt;', self.move_right)
  
      def draw(self):
          self.canvas.move(self.id, self.xspeed, 0)
          pos = self.canvas.coords(self.id)
          if pos[0] &lt;= 0:
              self.xspeed = 0
          if pos[2] &gt;= 500:
              self.xspeed = 0
  
      def move_left(self, evt):
          self.xspeed = -12
      def move_right(self, evt):
          self.xspeed = 12
  
  tk = Tk()
  tk.title("Pong")
  canvas = Canvas(tk, width=500, height=400, bd=0, bg='#ff4fea')
  canvas.pack()
  label = canvas.create_text(5, 5, anchor=NW, text="Score: 0")
  tk.update()
  paddle = Paddle(canvas, '#2be2ff')
  ball = Ball(canvas, '#ddff00', 38, paddle)
  
  while ball.hit_bottom == False:
      ball.draw()
      paddle.draw()
      canvas.itemconfig(label, text="Score: "+str(ball.score))
      tk.update_idletasks()
      tk.update()
      time.sleep(0.01)
  
  while ball.hit_bottom == True:
      print
      go_label = canvas.create_text(250,200,text="Game Over Play Again")
  tk.update()
  </code></pre>