title: How to make my while loop restart with a counter
body: <p>I want to make a counter that counts down and restarts the loop when it reaches <code>0</code> like a game and makes <code>mr_krabs2</code> spawn where he was at the beginning.</p>
  <pre class="lang-py prettyprint-override"><code># Graphing frame 3.
  win3 = GraphWin('Frame.3', 640, 360)
  mr_krabs2 = Image(Point(600, 315), 
  r&quot;\Users\OneDrive\Desktop\Mr.Krabs2.png&quot;)
  win3.setBackground(&quot;lightblue&quot;)      
  # Drawing the inserted images.
  mr_krabs2.draw(win3)   
  # X and Y Variables.
  x = 0.0
  y = 0.0   
  while True:
      key = win3.getKey()    
      if key == &quot;w&quot;:
          mr_krabs2.move(0,-10)
          y = y + 10
          print(&quot;\nx =&quot;,x,&quot;y =&quot;,y,&quot;\n&quot;)   
      if key == &quot;s&quot;:
          mr_krabs2.move(0,10)
          y = y - 10
          print(&quot;\nx =&quot;,x,&quot;y =&quot;,y,&quot;\n&quot;)    
      if key == &quot;a&quot;:
          mr_krabs2.move(-10,0)
          x = x + 10
          print(&quot;\nx =&quot;,x,&quot;y =&quot;,y,&quot;\n&quot;) 
      if key == &quot;d&quot;:
          mr_krabs2.move(10,0)
          x = x - 10
          print(&quot;\nx =&quot;,x,&quot;y =&quot;,y,&quot;\n&quot;)
      # Hitbox for the destination.
      if (x &lt; (59) and
          x &gt; (52) and
          y &lt; (4) and
          y &gt; (-6)):
          time.sleep(5)
          win3.close()
          break
  </code></pre>