From 0840bb5fdaa3417b875e81c472ff2e096739484b 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, 5 Apr 2022 23:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AD=85=E6=83=91=E8=8F=87?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - source/component/plant.py | 2 +- source/state/level.py | 2 +- source/tool.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e1f48e5..5961892 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,6 @@ nuitka --mingw --standalone --onefile --show-progress --show-memory --output-dir * 修复已经死亡的僵尸会触发大嘴花、土豆雷甚至小推车的问题 * 用蓝色滤镜标识冷冻的僵尸 * 修复暂停游戏时仍在计时的bug -* 修复魅惑菇的bug ## 截屏 diff --git a/source/component/plant.py b/source/component/plant.py index 3255e38..2221b87 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -215,7 +215,7 @@ class Plant(pg.sprite.Sprite): if not zombie.lostHead: self.health -= damage self.hit_timer = self.current_time - if self.health == 0: + if (self.health == 0) or (self.name == c.HYPNOSHROOM and self.state != c.SLEEP): self.kill_zombie = zombie def getPosition(self): diff --git a/source/state/level.py b/source/state/level.py index eab2023..8d8d0bf 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -555,7 +555,7 @@ class Level(tool.State): zombie.setAttack(plant) for hypno_zombie in self.hypno_zombie_groups[i]: - if hypno_zombie.health <= 0: + if hypno_zombie.health < 70: continue zombie_list = pg.sprite.spritecollide(hypno_zombie, self.zombie_groups[i], False,collided_func) diff --git a/source/tool.py b/source/tool.py index a783d0b..2de067c 100755 --- a/source/tool.py +++ b/source/tool.py @@ -35,7 +35,7 @@ class Control(): self.screen = pg.display.get_surface() self.done = False self.clock = pg.time.Clock() # 创建一个对象来帮助跟踪时间 - self.fps = 60 + self.fps = 30 self.keys = pg.key.get_pressed() self.mouse_pos = None self.mouse_click = [False, False] # value:[left mouse click, right mouse click]