aboutsummaryrefslogtreecommitdiff
path: root/client/map/items/plate.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/map/items/plate.gd')
-rw-r--r--client/map/items/plate.gd10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd
index 3d5aa7a6..7019bcf8 100644
--- a/client/map/items/plate.gd
+++ b/client/map/items/plate.gd
@@ -20,10 +20,16 @@ extends Item
func _init(owned_by_: Node3D, contents: Array[String]):
super(owned_by_)
add_child(load("res://map/items/plate.tscn").instantiate())
+
+ var height_sum := 0.
for c in contents:
+ var item: Item
match c:
- "tomato-soup": add_child(PlateFill.new(self, Color(1., .3, .2)))
- _: base.add_child(ItemFactory.produce(c, base))
+ "tomato-soup": item = PlateFill.new(self, Color(1., .3, .2))
+ _: item = ItemFactory.produce(c, base)
+ base.add_child(item)
+ item.position.y = height_sum
+ height_sum += item.height()
func setup_sounds():
take_sound.setup([preload("res://map/items/sounds/plate_take.ogg")])