Example #1
0
 def floodFill(self, tile, start):
     (x, y) = start
     x = x / blocksize
     y = y / blocksize
     self.visited = [(x, y)]
     self.BFSQueue.reset()
     floodArea = misc.flatten(self.floodFillBFS((x, y)))
     floodArea = list(set(floodArea))
     for entry in floodArea:
         (x, y) = entry
         self.place(x, y, tile)
 def floodFill(self, tile, start):
     (x,y) = start
     x = x / blocksize
     y = y / blocksize
     self.visited = [ (x,y) ]
     self.BFSQueue.reset()
     floodArea = misc.flatten( self.floodFillBFS( (x,y) ) )
     floodArea = list( set(floodArea) )
     for entry in floodArea:
         (x,y) = entry
         self.place(x, y, tile)
Example #3
0
 def getLitTiles(self, l):
     (px, py) = self.playerXY
     self.BFSQueue.reset()
     self.visited = []
     if self.type == 'cave':
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
     else:
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
         litTiles = misc.flatten( self.litBFS( (px,py) ) )
     litTiles = list( set( litTiles) )
     self.litTiles = litTiles
     return litTiles
Example #4
0
 def getLitTiles(self, l):
     (px, py) = self.playerXY
     self.BFSQueue.reset()
     self.visited = []
     if self.type == 'cave':
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
     else:
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
         litTiles = misc.flatten(self.litBFS((px, py)))
     litTiles = list(set(litTiles))
     self.litTiles = litTiles
     return litTiles