aboutsummaryrefslogtreecommitdiff
path: root/client/map/items
diff options
context:
space:
mode:
Diffstat (limited to 'client/map/items')
-rw-r--r--client/map/items/item.gd3
-rw-r--r--client/map/items/plate.gd5
2 files changed, 8 insertions, 0 deletions
diff --git a/client/map/items/item.gd b/client/map/items/item.gd
index 688308fe..d3acf200 100644
--- a/client/map/items/item.gd
+++ b/client/map/items/item.gd
@@ -20,11 +20,14 @@ var owned_by: Node3D
var base: Node3D = Node3D.new()
var progress_instance: ProgressBar3D = preload("res://map/progress.tscn").instantiate()
+var sound_instance: PlayRandom = preload("res://audio/play_random.tscn").instantiate()
func _init(owned_by_: Node3D):
progress_instance.position.y = 1
progress_instance.visible = false
add_child(progress_instance)
+ add_child(sound_instance)
+ sound_instance.volume_db = -16
base.position = base_position()
add_child(base)
owned_by = owned_by_
diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd
index ac6a6c00..88403b55 100644
--- a/client/map/items/plate.gd
+++ b/client/map/items/plate.gd
@@ -19,6 +19,11 @@ extends Item
func _init(owned_by_: Node3D):
super(owned_by_)
add_child(load("res://map/items/plate.tscn").instantiate())
+ sound_instance.setup([preload("res://map/sounds/plate_up.ogg")])
+
+func take():
+ sound_instance.play_random()
+ super()
static func base_position() -> Vector3:
return Vector3(0., 0.05, 0.)