Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.70 KB | None | 0 0
  1.     def drawmap(self):  # TODO:Move draw functions into cell class
  2.         """Drawmap function.
  3.            Will draw map. Working with fov.
  4.        """
  5.         global gamemap,screen
  6.         mapx,mapy=0,0
  7.         for mapx in xrange(MAP_W - 1):
  8.             for mapy in xrange(MAP_H):
  9.                 if mapx <= 22 and mapx >= 1 and mapy <= 61 and mapy >= 1:
  10.                     if gamemap[mapx][mapy].lit:
  11.                         if self.inLos(mapx, mapy, x, y) and gamemap[mapx]\
  12.                                                 [mapy].visible == False:
  13.                             gamemap[mapx][mapy].visible = True
  14.                     if gamemap[mapx][mapy].visible:
  15.                         if gamemap[mapx][mapy].mob:
  16.                             gamemap[mapx][mapy].undercell.explored = True
  17.                         gamemap[mapx][mapy].explored = True
  18.                         screen.attron(screen.A_BOLD)
  19.                         self.printex(mapx, mapy, gamemap[mapx][mapy].char(),\
  20.                            gamemap[mapx][mapy].color,False)
  21.                         screen.attroff(screen.A_BOLD)
  22.                     elif gamemap[mapx][mapy].explored:
  23.                         screen.attron(screen.A_DIM)
  24.                         if gamemap[mapx][mapy].mob:
  25.                             self.printex(mapx, mapy, gamemap[mapx][mapy]\
  26.                                          .undercell.char(),5,False)
  27.                         self.printex(mapx, mapy, gamemap[mapx][mapy].char(),\
  28.                            5,False)
  29.                     else:
  30.                         self.printex(mapx, mapy, " ",5,False)
  31.                         screen.attroff(screen.A_DIM)
  32.                        
  33.         screen.refresh()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement