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


Python Monster.jump方法代码示例

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


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

示例1: fuck

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import jump [as 别名]
    def fuck(self, m1, m2):
        if m1.rest or m2.rest:
            return

        baby = None
        if (m1.color == 'red' and m2.color == 'green') or (m1.color == 'green' and m2.color == 'red'):
            baby = Monster(self.board, 'blue', m1.position, blue_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: blue @ {}".format(baby.position))
            self.child_counter += 1
        elif (m1.color == 'green' and m2.color == 'blue') or (m1.color == 'blue' and m2.color == 'green'):
            baby = Monster(self.board, 'yellow', m1.position, yellow_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: yellow @ {}".format(baby.position))
            self.child_counter += 1
        elif (m1.color == 'blue' and m2.color == 'yellow') or (m1.color == 'yellow' and m2.color == 'blue'):
            baby = Monster(self.board, 'pink', m1.position, pink_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: pink @ {}".format(baby.position))
            self.child_counter += 1
        elif (m1.color == 'yellow' and m2.color == 'pink') or (m1.color == 'pink' and m2.color == 'yellow'):
            baby = Monster(self.board, 'brown', m1.position, brown_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: brown @ {}".format(baby.position))
            self.child_counter += 1
        elif (m1.color == 'pink' and m2.color == 'brown') or (m1.color == 'brown' and m2.color == 'pink'):
            baby = Monster(self.board, 'red', m1.position, red_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: red @ {}".format(baby.position))
            self.child_counter += 1
        elif (m1.color == 'brown' and m2.color == 'red') or (m1.color == 'red' and m2.color == 'brown'):
            baby = Monster(self.board, 'green', m1.position, green_patterns)
            position = baby.jump()
            self.monsters.append(baby)
            print("New Monster: green @ {}".format(baby.position))
            self.child_counter += 1

        if baby:
            # check for numbers and operators on the board
            item = self.check_fields(baby, numbers)
            if item:
                self.collect[baby.color].append(item)

            return baby
开发者ID:tmusy,项目名称:Monster,代码行数:51,代码来源:game5.py


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