From dbcff71bc7b6de3a127bfc8f7577b8e260a51baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Wed, 11 May 2022 17:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=9F=E8=B1=86=E9=9B=B7?= =?UTF-8?q?=E4=B8=8D=E6=94=BB=E5=87=BB=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/component/plant.py b/source/component/plant.py index 77ee250..1336deb 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -728,7 +728,8 @@ class PotatoMine(Plant): def canAttack(self, zombie): if (self.name == c.POLE_VAULTING_ZOMBIE and (not self.jumped)): 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)): return True return False