title: Pygame problems: The sprite won't move when key pressed. And yes, I looked around on SO
body: <p>So I'm back at it with making a game again and I'm using Pygame.</p>
  
  <p>However, I need to move the player sprite. And it just won't cooperate.</p>
  
  <p>How it's meant to work is that when an arrow key is pressed, it should move the sprite in that corresponding arrow's direction. obvious enough haha.</p>
  
  <p>But it didn't. And there's no traceback as well.</p>
  
  <p>So I turn to my good friend, Stack Overflow.
  I tried out some answers but they just don't work for me. Or the mechanic of the game and the direction I'm taking it (pun not intended)</p>
  
  <p>So, anyone have any idea how to fix it?
  Here's the code. Full thing on GitHub (just in case): <a href="https://github.com/E-Lee-Za/Eleeza-Crafter-The-Game" rel="nofollow noreferrer">https://github.com/E-Lee-Za/Eleeza-Crafter-The-Game</a></p>
  
  <pre><code>import sys
  import time
  import pygame
  from pygame.locals import *
  
  pygame.init()
  #INITIALISE THE WINDOW.
  #CONSTANTS ARE CAPITAL, VARIABLES ARE LOWERCASE
  SCREENWIDTH = 1000
  SCREENHEIGHT = 650
  SCREENSIZE = [SCREENWIDTH, SCREENHEIGHT]
  screen = pygame.display.set_mode(SCREENSIZE)
  BG_COL = [255, 123, 67]
  clock = pygame.time.Clock()
  screen.fill(BG_COL)
  pygame.display.update()
  clock.tick(60)
  
  class Player(pygame.sprite.Sprite):
      def __init__(self):
          self.sprite = pygame.image.load("Sprites/player.png")
          self.x = 445
          self.y = 550
  
  #make functions        
  def handle_keys():
      """ Handles Keys """
      key = pygame.key.get_pressed()
      dist = 5 
      if key[pygame.K_DOWN]: # down key
          player.y += dist # move down
      elif key[pygame.K_UP]: # up key
          player.y -= dist # move up
      if key[pygame.K_RIGHT]: # right key
          player.x += dist # move right
      elif key[pygame.K_LEFT]: # left key
          player.x -= dist # move left
  
  #MAIN GAME LOOP (WHERE WE PUT ALL THE FUNCTIONS TOGETHER)
  running = True
  while running:   
      for events in pygame.event.get():
          if events.type == QUIT:
              pygame.quit()
              exit()
              running = False
  
      #UNNECESSARY STUFF
  
      player = Player()
      #IF KEY PRESSED
      #MOVE PLAYER SPRITE
      screen.blit(player.sprite, (player.x, player.y))
      handle_keys()
      pygame.display.update()
  </code></pre>
  
  <p>Thank you :)</p>