铲子使用后自动复原
This commit is contained in:
parent
74e79df465
commit
bfa4445b24
@ -259,9 +259,12 @@ class Level(tool.State):
|
|||||||
x, y = mouse_pos
|
x, y = mouse_pos
|
||||||
map_x, map_y = self.map.getMapIndex(x, y)
|
map_x, map_y = self.map.getMapIndex(x, y)
|
||||||
for i in self.plant_groups[map_y]:
|
for i in self.plant_groups[map_y]:
|
||||||
if(x >= i.rect.x and x <= i.rect.right and
|
if (x >= i.rect.x and x <= i.rect.right and
|
||||||
y >= i.rect.y and y <= i.rect.bottom):
|
y >= i.rect.y and y <= i.rect.bottom):
|
||||||
self.killPlant(i)
|
self.killPlant(i)
|
||||||
|
# 使用后默认铲子复原
|
||||||
|
self.drag_shovel = not self.drag_shovel
|
||||||
|
self.removeMouseImagePlus()
|
||||||
return
|
return
|
||||||
|
|
||||||
# 检查小铲子的位置有没有被点击
|
# 检查小铲子的位置有没有被点击
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user