本文整理汇总了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