title: How to attach an image to a rect in pygame?
body: <p>I need help attaching an image to a rectangle in pygame.. I am trying to make a snake game in python(you know, the one that eats the apples and grows lol) and I wanna attach my teacher's face to head of the snake.</p>
  
  <p>I've already tried defining a variable to import the image and then renaming the rectangle to be that image, but nothing seems to work.</p>
  
  <pre><code>snakeFace = pygame.image.load("Morrison.jpg").convert_alpha()
  rect = snakeFace.get_rect()
  screenWidth = 500
  X=50
  y= 50
  height = 20
  vel = 20
  run = True
  lastKey = None
  while run:
      pygame.time.delay(10) #1/2 milisecond delay
  for event in pygame.event.get():
      if event.type == pygame.QUIT:
          run = False #this controls the "X" button
      if event.type == pygame.KEYDOWN:
          lastKey = event.key
  
      keys = pygame.key.get_pressed()
      if lastKey == pygame.K_LEFT and x &gt; vel:
          x-=vel
      if lastKey == pygame.K_RIGHT and x&lt; screenWidth - width -vel:
          x+=vel
      if lastKey == pygame.K_DOWN and y &lt; screenWidth - height - vel:
          y+= vel
      if lastKey == pygame.K_UP and y &gt; vel:
          y-=vel
  
      win.fill((0,0,0))
      pygame.draw.rect(win, (255, 0, 0), (x, y, width, height))
      pygame.display.update()
  </code></pre>
  
  <p>I expected there to be a square with my teachers face on it that runs around on the screen after a particular key is pressed on the screen but its just the regular old red square.</p>