title: Pygame: Move picture while key is being held
body: <p>i´m trying to move picture while key is being held, but it always moves just by one pixel. In questions similar to this I saw this is right, but it is not working for me. </p>
  
  <pre><code>import pygame, sys
  
  x = 0
  y = 0
  
  
  class Ship:
      def __init__(self, image):
          self.image = pygame.image.load(image)
  
      def Play(self, screen, x, y):
          self.screen = screen
          self.screen.blit(self.image, [x, y])
  
  
  if __name__ == "__main__":
      ship = Ship('Lod.png')
      while True:
          window = pygame.display.set_mode([1000, 1000])
          window.fill([0, 105, 148])
  
          Key = pygame.key.get_pressed()
          if Key[pygame.K_LEFT]:
              x -= 1
          if Key[pygame.K_RIGHT]:
              x += 1
  
          ship.Play(window, x, y)
  
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  sys.exit()
          pygame.display.flip()
  </code></pre>