Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def drawmap(self): # TODO:Move draw functions into cell class
- """Drawmap function.
- Will draw map. Working with fov.
- """
- global gamemap,screen
- mapx,mapy=0,0
- for mapx in xrange(MAP_W - 1):
- for mapy in xrange(MAP_H):
- if mapx <= 22 and mapx >= 1 and mapy <= 61 and mapy >= 1:
- if gamemap[mapx][mapy].lit:
- if self.inLos(mapx, mapy, x, y) and gamemap[mapx]\
- [mapy].visible == False:
- gamemap[mapx][mapy].visible = True
- if gamemap[mapx][mapy].visible:
- if gamemap[mapx][mapy].mob:
- gamemap[mapx][mapy].undercell.explored = True
- gamemap[mapx][mapy].explored = True
- screen.attron(screen.A_BOLD)
- self.printex(mapx, mapy, gamemap[mapx][mapy].char(),\
- gamemap[mapx][mapy].color,False)
- screen.attroff(screen.A_BOLD)
- elif gamemap[mapx][mapy].explored:
- screen.attron(screen.A_DIM)
- if gamemap[mapx][mapy].mob:
- self.printex(mapx, mapy, gamemap[mapx][mapy]\
- .undercell.char(),5,False)
- self.printex(mapx, mapy, gamemap[mapx][mapy].char(),\
- 5,False)
- else:
- self.printex(mapx, mapy, " ",5,False)
- screen.attroff(screen.A_DIM)
- screen.refresh()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement