修复土豆雷不攻击的bug

This commit is contained in:
星外之神 2022-05-11 17:30:14 +08:00
parent ee50c004b3
commit dbcff71bc7

View File

@ -728,7 +728,8 @@ class PotatoMine(Plant):
def canAttack(self, zombie): def canAttack(self, zombie):
if (self.name == c.POLE_VAULTING_ZOMBIE and (not self.jumped)): if (self.name == c.POLE_VAULTING_ZOMBIE and (not self.jumped)):
return False return False
elif (pg.sprite.collide_mask(zombie, self) and # 这里碰撞应当比碰撞一般更容易就设置成圆形或矩形模式不宜采用mask
elif (pg.sprite.collide_circle_ratio(0.7)(zombie, self) and
(not self.is_init) and (not zombie.lostHead)): (not self.is_init) and (not zombie.lostHead)):
return True return True
return False return False