title: pygame.error: no video mode has been set
body: <p>error:</p>
  
  <pre><code>File "E:/advcomp/game/mainGame.py", line 3, in &lt;module&gt;
      from Loading import *
    File "E:\advcomp\game\Loading.py", line 37, in &lt;module&gt;
      gameMap = pytmx.load_pygame("gameMap.tmx", pixelalpha = True)
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\util_pygame.py", line 116, in load_pygame
      return pytmx.TiledMap(filename, *args, **kwargs)
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\pytmx.py", line 285, in __init__
      self.parse_xml(ElementTree.parse(self.filename).getroot())
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\pytmx.py", line 357, in parse_xml
      self.reload_images()
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\pytmx.py", line 429, in reload_images
      image = loader()
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\util_pygame.py", line 90, in load_image
      tile = smart_convert(tile, colorkey, pixelalpha)
    File "C:\Users\Administrator.BAC-F060-D003.000\Desktop\pythonFiles\lib\site-packages\pytmx\util_pygame.py", line 54, in smart_convert
      tile = original.convert_alpha()
  pygame.error: No video mode has been set
  </code></pre>
  
  <p>The error first occured when i added the line: <code>gameMap = pytmx.load_pygame("gameMap.tmx", pixelalpha = True)</code> in Loading.py</p>
  
  <p>mainGame.py:</p>
  
  <pre><code>import pygame
  from settings import *
  from Loading import *
  from characters import *
  
  pygame.init()
  
  class game():
  
      def __init__(self):
  
          self.gameRunning = True
          self.gameWindow = pygame.display.set_mode((gameWindowWidth, gameWindowHeight))
          pygame.display.set_caption(title)
          self.clock = pygame.time.Clock()
          self.playerSpeed = speed
  
      def update(self):
  
          self.gameWindow.blit(distantCity, (0,0))
          for layer in gameMap.visible_layers:
              for x, y, gid, in layer:
                  tile = gameMap.get_tile_image_by_gid(gid)
                  self.gameWindow.blit(tile, (x * gameMap.tilewidth, y * gameMap.tileheight))
          self.gameWindow.blit(ninjaIdle01, (player1.playerX, player1.playerY))
          pygame.display.update()
  
      def gameLoop(self):
  
          self.clock.tick(FPS)
          self.event()
          self.update()
  
      def event(self):
  
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  self.gameRunning = False
  
              if event.type == pygame.KEYDOWN and event.key == pygame.K_RIGHT:
                  self.playerSpeed = 5
              if event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT:
                  self.playerSpeed = -5
              if event.type == pygame.KEYUP and event.key == pygame.K_RIGHT:
                  self.playerSpeed = 0
              if event.type == pygame.KEYUP and event.key == pygame.K_LEFT:
                  self.playerSpeed = 0
  
          player1.playerX = player1.playerX + self.playerSpeed
  
  playGame = game()
  player1 = player()
  while playGame.gameRunning == True:
      playGame.gameLoop()
  
  
  pygame.quit()
  quit()
  </code></pre>
  
  <p>Loading.py:</p>
  
  <pre><code>import pygame
  import pytmx
  
  pygame.init()
  
  ninjaIdle01 = pygame.image.load("gameImages\s_ninjaIdle_01.png")
  ninjaIdle02 = pygame.image.load("gameImages\s_ninjaIdle_02.png")
  ninjaIdle03 = pygame.image.load("gameImages\s_ninjaIdle_03.png")
  ninjaIdle04 = pygame.image.load("gameImages\s_ninjaIdle_04.png")
  ninjaIdle05 = pygame.image.load("gameImages\s_ninjaIdle_05.png")
  ninjaIdle06 = pygame.image.load("gameImages\s_ninjaIdle_06.png")
  ninjaIdle07 = pygame.image.load("gameImages\s_ninjaIdle_07.png")
  ninjaIdle08 = pygame.image.load("gameImages\s_ninjaIdle_08.png")
  ninjaIdle09 = pygame.image.load("gameImages\s_ninjaIdle_09.png")
  ninjaIdle10 = pygame.image.load("gameImages\s_ninjaIdle_10.png")
  ninjaJump01 = pygame.image.load("gameImages\s_ninjaJump_01.png")
  ninjaJump02 = pygame.image.load("gameImages\s_ninjaJump_02.png")
  ninjaJump03 = pygame.image.load("gameImages\s_ninjaJump_03.png")
  ninjaJump04 = pygame.image.load("gameImages\s_ninjaJump_04.png")
  ninjaJump05 = pygame.image.load("gameImages\s_ninjaJump_05.png")
  ninjaJump06 = pygame.image.load("gameImages\s_ninjaJump_06.png")
  ninjaJump07 = pygame.image.load("gameImages\s_ninjaJump_07.png")
  ninjaJump08 = pygame.image.load("gameImages\s_ninjaJump_08.png")
  ninjaJump09 = pygame.image.load("gameImages\s_ninjaJump_09.png")
  ninjaJump10 = pygame.image.load("gameImages\s_ninjaJump_10.png")
  ninjaRun01 = pygame.image.load("gameImages\s_ninjaRun_01.png")
  ninjaRun02 = pygame.image.load("gameImages\s_ninjaRun_02.png")
  ninjaRun03 = pygame.image.load("gameImages\s_ninjaRun_03.png")
  ninjaRun04 = pygame.image.load("gameImages\s_ninjaRun_04.png")
  ninjaRun05 = pygame.image.load("gameImages\s_ninjaRun_05.png")
  ninjaRun06 = pygame.image.load("gameImages\s_ninjaRun_06.png")
  ninjaRun07 = pygame.image.load("gameImages\s_ninjaRun_07.png")
  ninjaRun08 = pygame.image.load("gameImages\s_ninjaRun_08.png")
  ninjaRun09 = pygame.image.load("gameImages\s_ninjaRun_09.png")
  ninjaRun10 = pygame.image.load("gameImages\s_ninjaRun_10.png")
  distantCity = pygame.image.load("gameImages\s_distantCity.png")
  gameMap = pytmx.load_pygame("gameMap.tmx", pixelalpha = True)
  </code></pre>
  
  <p>gameMap.tmx:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;map version="1.0" orientation="orthogonal" renderorder="right-down" width="20" height="10" tilewidth="128" tileheight="128" nextobjectid="1"&gt;
   &lt;tileset firstgid="1" name="platformerTiles" tilewidth="128" tileheight="128" tilecount="6" columns="0"&gt;
    &lt;tile id="0"&gt;
     &lt;image width="128" height="128" source="gameImages/dirtLeft.png"/&gt;
    &lt;/tile&gt;
    &lt;tile id="1"&gt;
     &lt;image width="128" height="128" source="gameImages/dirtMiddle.png"/&gt;
    &lt;/tile&gt;
    &lt;tile id="2"&gt;
     &lt;image width="128" height="128" source="gameImages/dirtRight.png"/&gt;
    &lt;/tile&gt;
    &lt;tile id="3"&gt;
     &lt;image width="128" height="128" source="gameImages/grassLeft.png"/&gt;
    &lt;/tile&gt;
    &lt;tile id="4"&gt;
     &lt;image width="128" height="128" source="gameImages/grassMiddle.png"/&gt;
    &lt;/tile&gt;
    &lt;tile id="5"&gt;
     &lt;image width="128" height="128" source="gameImages/grassRight.png"/&gt;
    &lt;/tile&gt;
   &lt;/tileset&gt;
   &lt;layer name="Tile Layer 1" width="20" height="10"&gt;
    &lt;data encoding="csv"&gt;
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,
  1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,
  1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3
  &lt;/data&gt;
   &lt;/layer&gt;
  &lt;/map&gt;
  </code></pre>