From b2a7c22be6d2f4470a15346e34fbdb13bb4b2f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Thu, 28 Jul 2022 16:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89=E9=93=B2?= =?UTF-8?q?=E5=AD=90=E5=85=B3=E5=8D=A1=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E9=93=B2=E5=AD=90=E7=82=B9=E5=87=BB=E5=AF=BC=E8=87=B4=E9=97=AA?= =?UTF-8?q?=E9=80=80=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/state/level.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/state/level.py b/source/state/level.py index 149b3eb..f98cd2f 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -768,15 +768,16 @@ class Level(tool.State): self.showLittleMenu = True # 播放点击音效 c.SOUND_BUTTON_CLICK.play() - elif self.inArea(self.shovel_box_rect, *mouse_pos): - self.drag_shovel = not self.drag_shovel - if not self.drag_shovel: - self.removeMouseImagePlus() - # 播放点击铲子的音效 - c.SOUND_SHOVEL.play() - elif self.drag_shovel: - # 移出这地方的植物 - self.shovelRemovePlant(mouse_pos) + elif self.hasShovel: + if self.inArea(self.shovel_box_rect, *mouse_pos): + self.drag_shovel = not self.drag_shovel + if not self.drag_shovel: + self.removeMouseImagePlus() + # 播放点击铲子的音效 + c.SOUND_SHOVEL.play() + elif self.drag_shovel: + # 移出这地方的植物 + self.shovelRemovePlant(mouse_pos) for car in self.cars: if car: