From d1e1c3757cded16c275a66582e5519060f031574 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 10:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=80=AD=E7=93=9C=E9=9F=B3?= =?UTF-8?q?=E6=95=88=E6=92=AD=E6=94=BE=E6=97=B6=E9=97=B4?= 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 26528ce..86c465e 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -716,8 +716,6 @@ class Squash(Plant): self.state = c.ATTACK # 攻击状态下生命值无敌 self.health = float('inf') - # 锁定目标时播放音效 - pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "squashHmm.ogg")).play() def attacking(self): if self.squashing: @@ -729,6 +727,8 @@ class Squash(Plant): self.mapPlantsSet.remove(c.SQUASH) self.kill() elif self.aim_timer == 0: + # 锁定目标时播放音效 + pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "squashHmm.ogg")).play() self.aim_timer = self.current_time self.changeFrames(self.aim_frames) elif (self.current_time - self.aim_timer) > 1000: