From b1941820c624bf63a92588f3f8c2ab3a11dab52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Tue, 19 Apr 2022 00:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B2=E5=AD=90=E6=8C=87=E5=90=91=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E6=A4=8D=E7=89=A9=E6=97=B6=E5=8F=AA=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E5=B0=86=E7=A7=BB=E9=99=A4=E7=9A=84=E9=82=A3=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/zombie.py | 2 ++ source/state/level.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/component/zombie.py b/source/component/zombie.py index 11af0c9..4b5a869 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -80,6 +80,8 @@ class Zombie(pg.sprite.Sprite): self.health -= (self.current_time - self.losthead_timer) / 40 self.losthead_timer = self.current_time return False + else: + return False def walking(self): if self.checkToDie(self.losthead_walk_frames): diff --git a/source/state/level.py b/source/state/level.py index bce5b33..9b0cf10 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -828,11 +828,12 @@ class Level(tool.State): self.shovel_rect.centery = y # 铲子接近植物时会高亮提示 map_x, map_y = self.map.getMapIndex(x, y) + surface.blit(self.shovel, self.shovel_rect) for i in self.plant_groups[map_y]: if (x >= i.rect.x and x <= i.rect.right and y >= i.rect.y and y <= i.rect.bottom): i.highlightTime = self.current_time - surface.blit(self.shovel, self.shovel_rect) + return def drawZombieFreezeTrap(self, i, surface): for zombie in self.zombie_groups[i]: