Backfill slots when dropping

This commit is contained in:
Olivier 'reivilibre' 2023-01-08 23:48:05 +00:00
parent e528126fd2
commit 49bd7cd62c

View File

@ -83,6 +83,12 @@ func _act_drop():
var child = $ItemHolder1.get_child(0)
child.drop(self, direction * 10)
if $ItemHolder2.get_child_count() > 0:
# backfill the child
var new_child = $ItemHolder2.get_child(0)
$ItemHolder2.remove_child(new_child)
$ItemHolder1.add_child(new_child)
var press_area_press = null
func on_press_area_entered(press: Node2D):