From ba1788bf5c1494baec6e3ee3812a05f3568910de 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, 6 May 2022 14:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=9F=E8=B1=86=E9=9B=B7?= =?UTF-8?q?=E8=AE=BE=E5=AE=9A?= 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 79b9a7e..d5127a0 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -593,7 +593,7 @@ class PotatoMine(Plant): self.is_init = True self.init_timer = 0 self.bomb_timer = 0 - self.explode_x_range = c.GRID_X_SIZE / 2 + self.explode_x_range = c.GRID_X_SIZE * 0.6 def loadImages(self, name, scale): self.init_frames = [] @@ -621,8 +621,8 @@ class PotatoMine(Plant): self.is_init = False def canAttack(self, zombie): - if (not self.is_init and zombie.rect.right >= self.rect.x and (not zombie.lostHead) and - (abs(zombie.rect.x - self.rect.x) <= self.explode_x_range)): + if (not self.is_init and (not zombie.lostHead) and + (abs(zombie.rect.x - self.rect.x) <= self.explode_x_range*(5/6))): return True return False