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


Python Map.isItem方法代码示例

本文整理汇总了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())
开发者ID:ValentinPearce,项目名称:The-Shades,代码行数:12,代码来源:OriginalGame.py

示例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()
开发者ID:ValentinPearce,项目名称:The-Shades,代码行数:75,代码来源:Game.py


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