本文整理汇总了Python中Player.set_room方法的典型用法代码示例。如果您正苦于以下问题:Python Player.set_room方法的具体用法?Python Player.set_room怎么用?Python Player.set_room使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.set_room方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: player_start
# 需要导入模块: import Player [as 别名]
# 或者: from Player import set_room [as 别名]
def player_start(cave_list, spawn_list):
for item in cave_list:
if item.get_pit() == False and item.get_bat() == False and item.get_wumpus() == False:
spawn_list.append(item)
spawn_room = random.choice(spawn_list)
Player.set_room(spawn_room.get_value())
示例2: teleport_check
# 需要导入模块: import Player [as 别名]
# 或者: from Player import set_room [as 别名]
def teleport_check(Player, cave_list):
copy_cave = cave_list[:]
for item in cave_list:
if item.get_bat() == True:
while item.get_value() == Player.get_room():
copy_cave.remove(item)
random_cave = random.choice(copy_cave)
Player.set_room(random_cave.get_value())
示例3: playerCopier
# 需要导入模块: import Player [as 别名]
# 或者: from Player import set_room [as 别名]
def playerCopier(Player, morsel):
x = morsel.split(".")
Player.set_arrows(int(x[0]))
Player.set_room(int(x[2]))
示例4: print
# 需要导入模块: import Player [as 别名]
# 或者: from Player import set_room [as 别名]
print("You can travel to:", room_connection)
print("You can shoot an arrow or move: ")
# Gather user input if moving or shooting
decision=input("Which would you like to do?: ")
print()
if (decision.lower() == "quit" or decision == "q"):
done = True
# If choice was to move, get input
if (decision.lower() == "move" or decision == "m"):
user_input = int(input("Which room would you like to travel to? "))
# check to see if user input was a correct room to travel
if (user_input not in room_connection):
continue
# Set Player's current room to user input
Player.set_room(user_input)
teleport_check(Player, cave_list)
warning_message_check(Player, cave_list)
if game_over_check(Player, cave_list):
done = True
# If choice was to shoot, gather input, valid check, game winning check
if decision.lower() == "shoot" or decision == "s":
shoot_list = []
user_input = input("Enter room chain to shoot arrow: ")
for num in user_input.split():
shoot_list.append(int(num))
if len(shoot_list) == 1 and shoot_list[0] == Player.get_room():
print("You shot an arrow in current room, you pick up the arrow")
continue
if len(shoot_list) < 5 and len(shoot_list) > 0: