Exemplo n.º 1
0
 def generate_map(self):
     self.tf = TerrainFactory()
     
     _map = []
     
     # initialize map
     _ca = CA_CaveFactory(self.lvl_length, self.lvl_width - 10, 0.45)
     _cave = _ca.gen_map([False,False])
     
     for _row in _cave:
         _line = [self.tf.get_terrain_tile(PERM_WALL)]
         _line += [self.tf.get_terrain_tile(PERM_WALL) for j in range(4)]
         _line += _row
         _line += [self.tf.get_terrain_tile(PERM_WALL) for j in range(4)]
         _line.append(self.tf.get_terrain_tile(PERM_WALL))
         _map.append(_line)
     
     self.map = _map
     
     # clear out middle section of map
     for _row in range(8, self.lvl_length - 9):
         for _col in range(7, self.lvl_width - 10):
             self.map[_row][_col] = self.tf.get_terrain_tile(FLOOR)
             
     # Now draw the tunnel entrance tunnel
     self.draw_entrance_tunnel()
     if self.level_num == 13:
         self.draw_exit_tunnel()
     self.add_buildings()
     self.add_toxic_pools()
Exemplo n.º 2
0
    def generate_level(self):
        self.map = []
        self.length = 60
        self.width = 80
        self.complex_length = 50
        self.complex_width = 70

        self.__tf = TerrainFactory()
        _ca = CA_CaveFactory(self.length, self.width, 0.50)
        self.map = _ca.gen_map([False,False])
        self.__generate_complex()
        
        self.downStairs = ''
        add_science_complex_rooms(self.dm, self, self)
        self.__set_east_wall()
        self.__add_pools()
        self.__add_monsters()
        self.__add_items_to_level()
        
        GameLevel.add_monster(self, Roomba3000(self.dm, 0, 0))
Exemplo n.º 3
0
 def __generate_map(self):
     _cf = CA_CaveFactory(self.lvl_length, self.lvl_width)
     self.map = _cf.gen_map()
     self.upStairs = _cf.upStairs
     self.downStairs = _cf.downStairs