title: How do i make an enemy gradually follow the player in Pygame?
body: <p>I have tried making a game and everything has been running smoothly until I tried to make a simple enemy AI. All I need it to do is gradually follow the player and I have tried doing it this way but it pauses the entire game.</p>
  <pre><code>        keys_pressed = pygame.key.get_pressed()
          if keys_pressed[pygame.K_w]:
              plr.y -= 3
              moveEnemy(emy, plr)
          if keys_pressed[pygame.K_s]:
              plr.y += 3
              moveEnemy(emy, plr)
  
  
          draw_window(plr, emy)
      pygame.quit()
  
  def moveEnemy(emy, plr):
      while emy.y != plr.y:
          time.sleep(.25)
          emy.y -= (emy.y - plr.y) - 2
  </code></pre>
  <p>Does anyone know a better way I can do this?</p>