本文整理汇总了Python中Map.isItem方法的典型用法代码示例。如果您正苦于以下问题:Python Map.isItem方法的具体用法?Python Map.isItem怎么用?Python Map.isItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.isItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pickList
# 需要导入模块: import Map [as 别名]
# 或者: from Map import isItem [as 别名]
def pickList(): #Renvoie la liste des objets ramassables
global items, pick
items = Map.isItem(Player.getPosition())
if items == 0:
return "Il n'y a pas d'objets dans cette zone."
elif Player.isItem() == 6:
return "Vous n'avez plus de place dans votre inventaire."
else:
pick = 1
return "Quel objet voulez-vous ramasser? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Map.getItemList(Player.getPosition())
示例2: getAction
# 需要导入模块: import Map [as 别名]
# 或者: from Map import isItem [as 别名]
def getAction(): # Traite les interactions clavier
global pick, use, throw
while 1:
command = raw_input()
if len(command) == 0:
return baseDescript()
command = command.split()
if command[0] == controls[0]:
return altDescript()
elif command[0] == controls[1]:
return move(command[0])
elif command[0] == controls[2]:
return move(command[0])
elif command[0] == controls[3]:
return move(command[0])
elif command[0] == controls[4]:
return move(command[0])
elif command[0] == controls[5]:
return "AAAAAAAAAARGH!!!!!!!"
elif command[0] == controls[6]:
return attack()
elif command[0] == controls[7]:
return useList()
elif command[0] == controls[8]:
return throwList()
elif command[0] == controls[9]:
return pickList()
elif command[0] == "w" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),0)
elif use == 1:
return useItem(0)
elif throw == 1:
return throwItem(Player.getPosition(),0)
elif command[0] == "x" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),1)
elif use == 1:
return useItem(1)
elif throw == 1:
return throwItem(Player.getPosition(),1)
elif command[0] == "c" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),2)
elif use == 1:
return useItem(2)
elif throw == 1:
return throwItem(Player.getPosition(),2)
elif command[0] == "v" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),3)
elif use == 1:
return useItem(3)
elif throw == 1:
throwItem(Player.getPosition(),3)
elif command[0] == "b" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),4)
elif use == 1:
return useItem(4)
elif throw == 1:
return throwItem(Player.getPosition(),4)
elif command[0] == "n" and Map.isItem(Player.getPosition()) >= 1:
if pick == 1:
return pickItem(Player.getPosition(),5)
elif use == 1:
return useItem(5)
elif throw == 1:
return throwItem(Player.getPosition(),5)
elif command[0] == controls[10]:
exitGame()
else:
return baseDescript()