From e17c16927ffc1000a13eacd0c9df9ce1183a7b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Sat, 14 May 2022 23:33:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=AD=E7=93=9C=E4=BD=8D=E7=BD=AE=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=94=B9=E4=B8=BA=E9=87=8D=E5=8F=A020=E5=83=8F?= =?UTF-8?q?=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index c71e89d..748d675 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -784,11 +784,11 @@ class Squash(Plant): # 僵尸在倭瓜右侧 if zombie.rect.x >= self.rect.x: # 重叠15%判断为可以攻击 - if (self.rect.right - zombie.rect.left >= 0.15*zombie.rect.width): + if (self.rect.right - zombie.rect.left >= 20): return True # 僵尸在倭瓜右侧 else: - if (zombie.rect.right - self.rect.left >= 0.15*zombie.rect.width): + if (zombie.rect.right - self.rect.left >= 20): return True # 碰撞检测 if pg.sprite.collide_mask(zombie, self):