From bfa4445b249ad9c5df70c35023d515c2e00580d0 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 21:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B2=E5=AD=90=E4=BD=BF=E7=94=A8=E5=90=8E?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=8D=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/state/level.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/state/level.py b/source/state/level.py index 3aff6ed..eab2023 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -259,10 +259,13 @@ class Level(tool.State): x, y = mouse_pos map_x, map_y = self.map.getMapIndex(x, y) 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): - self.killPlant(i) - return + if (x >= i.rect.x and x <= i.rect.right and + y >= i.rect.y and y <= i.rect.bottom): + self.killPlant(i) + # 使用后默认铲子复原 + self.drag_shovel = not self.drag_shovel + self.removeMouseImagePlus() + return # 检查小铲子的位置有没有被点击 # 方便放回去