当前位置: 首页>>代码示例>>Python>>正文


Python Level.values方法代码示例

本文整理汇总了Python中level.Level.values方法的典型用法代码示例。如果您正苦于以下问题:Python Level.values方法的具体用法?Python Level.values怎么用?Python Level.values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在level.Level的用法示例。


在下文中一共展示了Level.values方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_level

# 需要导入模块: from level import Level [as 别名]
# 或者: from level.Level import values [as 别名]
    def generate_level(self):
        self._level_count += 1
        min_rooms = 5
        size = 20, 20

        # generate the tile types
        tiletypes, rooms = self._level_generator.generate(size, min_rooms)
        level = Level(self.player, tiletypes, self._level_count)

        # generate the objects
        objects = self._object_generator.generate(min_rooms, self._level_count)
        self._object_generator.place_objects(objects, level)

        # generate monsters
        species = self._species_generator.generate_level(self._level_count)
        beings = [Being(self.controller, s) for s in species]
        self._species_generator.place_beings(beings, level)

        # set the player on a up staircase
        tile = level.staircases_up[0]
        level.add_being(tile, self.player)

        self.levels.append(level)
        self._current_level = level

        # housekeeping
        # FIXME this will need to move to change_level
        for being in [b for b in level.beings]:
            being.new_level(level._size)
        self.turn_done(move_monsters=False)

        for being in [t.being for t in level.values() if t.being and self.player.vision.can_see(t)]:
            being.has_been_seen = True

        return level
开发者ID:nate1001,项目名称:vecter_hack,代码行数:37,代码来源:game.py


注:本文中的level.Level.values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。