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


Python World.load_tiles方法代码示例

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


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

示例1: play

# 需要导入模块: import World [as 别名]
# 或者: from World import load_tiles [as 别名]
def play():
    World.load_tiles()
    gamePlayer = Player()
    while gamePlayer.is_alive() and not gamePlayer.victory:
        room = World.tile_exists(gamePlayer.location_x, gamePlayer.location_y)
        room.modify_Player(gamePlayer)
        if gamePlayer.is_alive() and not gamePlayer.victory:
            print   ("What will you do?:\n")
            available_actions = room.available_Actions()
            for action in available_actions:
                print   (action)
            Action_input = raw_input('Action: ')
            for checkAction in available_actions:
                if Action_input == checkAction.hotkey:
                        gamePlayer.do_action(checkAction, **checkAction.kwargs)
                        break
开发者ID:Captain-Eli,项目名称:Cranberries,代码行数:18,代码来源:Game.py

示例2: play

# 需要导入模块: import World [as 别名]
# 或者: from World import load_tiles [as 别名]
def play():
	World.load_tiles()
	player = Player()
	#These lines load the starting room and display the text
	while player.is_alive() and not player.victory:
		room = World.tile_exists(player.location_x, player.location_y)
		room.modify_Player(player)
		#check again since the room could have changed the player's state
		print("choose an action:\n")
		available_actions = room.available_actions()
		for action in available_actions:
			print(action)
		action_input = input('action: ')
		for action in available_actions:
			if action_input == action.hotkey:
				player.do_action(action, **action.kwargs)
				break
开发者ID:IceProdigyHaku,项目名称:Adventure-Tutorial,代码行数:19,代码来源:Game.py


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