diff --git a/.gitignore b/.gitignore index 09c5206..911184e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ mono_crash.*.json # Python __pycache__/ +venv \ No newline at end of file diff --git a/script/card.gd b/script/card.gd index 215e0a2..a6b0e97 100644 --- a/script/card.gd +++ b/script/card.gd @@ -119,15 +119,15 @@ func _on_pressed(): if has_chosen: # 已经选中,再次点击说明取消选择 has_chosen = false - position = on_board_pos + create_tween().tween_property(self, "position", on_board_pos, 0.2) PlantsBarAutoload.cancel(board_index) else: # 选中该植物 if PlantsBarAutoload.choose == PlantsBarAutoload.MAXNUM: return var pos_get = PlantsBarAutoload.add() - position.y = PlantsBarAutoload.BAR_Y - position.x = pos_get[1] + var target_pos = Vector2(pos_get[1], PlantsBarAutoload.BAR_Y) + create_tween().tween_property(self, "position", target_pos, 0.2) board_index = pos_get[0] has_chosen = true diff --git a/tools/pre-commit b/tools/pre-commit index 0ce6a6b..8baeae6 100644 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -3,6 +3,4 @@ # format gdscript gdformat . # lint gdscript -gdlint . -# save -git add -A +gdlint . \ No newline at end of file