From cb23817b0d730ef7d40a812cbafe367d10c16442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 20 May 2022 11:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=B1=E6=A1=83=E7=82=B8?= =?UTF-8?q?=E5=BC=B9=E7=88=86=E7=82=B8=E9=97=AA=E9=80=80bug=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=92=91=E6=9D=86=E8=B7=B3=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=9C=9F=E8=B1=86=E9=9B=B7=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index a3a8c37..38d0f1c 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -576,8 +576,8 @@ class CherryBomb(Plant): return self.animate_timer = self.current_time - self.image = self.frames[self.frame_index] - self.mask = pg.mask.from_surface(self.image) + self.image = self.frames[self.frame_index] + self.mask = pg.mask.from_surface(self.image) if (self.current_time - self.highlightTime < 100): self.image.set_alpha(150) @@ -735,7 +735,7 @@ class PotatoMine(Plant): self.is_init = False def canAttack(self, zombie): - if (self.name == c.POLE_VAULTING_ZOMBIE and (not self.jumped)): + if (zombie.name == c.POLE_VAULTING_ZOMBIE and (not zombie.jumped)): return False # 这里碰撞应当比碰撞一般更容易,就设置成圆形或矩形模式,不宜采用mask elif (pg.sprite.collide_circle_ratio(0.7)(zombie, self) and