Advertisement
Guest User

tiles.py

a guest
Jun 19th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import mapa
  2.  
  3. _mundo = {}
  4. pos_ini = (0,0)
  5.  
  6. def cargar_area():
  7.     with open('mapa_pueblo.txt', 'r') as f:
  8.         fila = f.readlines()
  9.     x_max = len(fila[0].split('\t'))
  10.     for y in range(len(fila)):
  11.         cols = fila[y].split('\t')
  12.         for x in range(x_max):
  13.             cuadrante = cols[x].replace('\n','')
  14.             if cuadrante == 'Pueblo_inicio':
  15.                 global pos_ini
  16.                 pos_ini = (x,y)
  17.             _mundo[(x,y)] = None if cuadrante == '' else getatrr(__import__('mapa'), cuadrante)(x,y)
  18.  
  19.  
  20. def area_existe(x):
  21.     return _mundo.get((x,y))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement