title: How do I display a tiled map in Pygame using Tiled and pytmx?
body: <p>I'm aware there is a similar question but the answers were not specific enough to be useful in my case.</p>
  
  <p>I am trying to create a program that can display a tiled map created in Tiled and uploaded into Pygame using pytmx. The only issue I'm having is blitting the images onto the screen in Pygame.</p>
  
  <p>This is the error I keep receiving:
      Traceback (most recent call last):
      File "C:\Users\b\Desktop\Frozen Map Textures\test.py", line 32, in 
      screen.blit(images[i],(x*32,y*32))
      TypeError: argument 1 must be pygame.Surface, not None</p>
  
  <p>If anybody knows how to fix the issue is, I would be very grateful! Thanks for all your  help!</p>
  
  <p>The code is below:</p>
  
  <pre><code>import pygame
  from pytmx import load_pygame
  import random
  
  
  white = (255,255,255)
  
  
  #create window
  screenSize = (800,600)
  screen = pygame.display.set_mode(screenSize)
  pygame.display.set_caption("GameName")
  screen.fill(white)
  
  
  gameMap = load_pygame("Frozen.tmx")
  
  
  #creates list of single tiles in first layer
  images = []
  for y in range(50):
      for x in range(50):
          image = gameMap.get_tile_image(x,y,0)
          images.append(image)
  
  
  #displays tiles in locations
  i = 0
  for y in range(50):
      for x in range(50):
          screen.blit(images[i],(x*32,y*32))
          i += 1
  
  
  #main loop
  running = True
  while running:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              running = False
  
      pygame.display.flip()
  
  pygame.quit()
  </code></pre>