本文整理汇总了Python中Map.make_map方法的典型用法代码示例。如果您正苦于以下问题:Python Map.make_map方法的具体用法?Python Map.make_map怎么用?Python Map.make_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.make_map方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_game
# 需要导入模块: import Map [as 别名]
# 或者: from Map import make_map [as 别名]
def new_game():
global player, inventory, game_msgs, game_state, dungeon_level
#create object representing the player
entity_component = Entity(5)
GameState.player = Object(0, 0, '@', 'player', libtcod.white, blocks=True, entity=entity_component)
GameState.player.level = 1
#generate map (at this point it's not drawn to the screen)
dungeon_level = 1
Map.make_map()
initialize_fov()
game_state = 'playing'
GameState.inventory = []
#create the list of game messages and their colors, starts empty
GameState.game_msgs = []
#a warm welcoming message!
GUI.message('Welcome stranger! Prepare to perish in the Tombs of the Ancient Kings.', libtcod.red)
#initial equipment: a dagger
equipment_component = Equipment(slot='right hand', power_bonus=2)
obj = Object(0, 0, '-', 'dagger', libtcod.sky, equipment=equipment_component)
GameState.inventory.append(obj)
equipment_component.equip()
obj.always_visible = True