本文整理汇总了Python中map.Map.place_player方法的典型用法代码示例。如果您正苦于以下问题:Python Map.place_player方法的具体用法?Python Map.place_player怎么用?Python Map.place_player使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map.Map
的用法示例。
在下文中一共展示了Map.place_player方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_toggle_map
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import place_player [as 别名]
def handle_toggle_map():
global map
if not gl.__wizard_mode__:
return
map_name = gui.render_dialog('Enter map name')
gui.clear_screen()
dg = StaticRoomGenerator()
_map = dg.map_by_name(map_name)
if not _map:
gl.message('No such map', 'CRITICAL')
gui.render_messages()
return
map = Map(_map)
map.place_player(player)
map.place_random_monsters()
map.init_fov()
gui.viewport = None
gui.render_map(map,player)
示例2: DeityNPC
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import place_player [as 别名]
king_npc.deity = DeityNPC()
king_npc.deity.name = 'OMG'
king_npc.deity.altar_name = 'Bone altar of Kikubaaquadgha'
#requests.append(MapRequest('crypt', {'corpse': king_npc}))
requests.append(MapRequest('tower' , {'map_id' : 'tower_1', 'xy': (0, 0)}))
requests.append(MapRequest('tower' , {'map_id' : 'tower_1', 'xy': (11, 2)}))
requests.append(MapRequest('tower' , {'map_id' : 'tower_2', 'xy': (2, 15)}))
#map = DungeonGenerator.generate_map('rooms_corridor', theme='crypt', width=10, height=10, requests=requests )
#map = DungeonGenerator.generate_map('tesselate', theme='crypt', width=10, height=10, requests=requests )
#map = DungeonGenerator.generate_map('compound_tesselate_corridor', theme='crypt', width=10, height=10, requests=requests )
#map = DungeonGenerator.generate_map('cave', theme='crypt', width=10, height=10, requests=requests )
map = DungeonGenerator.generate_map('fill', theme='crypt', width=40, height=30, requests=None, params={'road_straight': True, 'road_break' : (1, 5), 'road_start' : (0, 5), 'road_end': (40, 30)})
map = Map(map)
map.prepare_level()
map.place_player(player)
map.configure()
map.place_random_monsters()
map.init_fov()
def main():
main_loop()
#import cProfile
#cProfile.run('main()')
if __name__ == "__main__":
main()