geluid voor laatje en kastje
This commit is contained in:
+11
-2
@@ -1,9 +1,18 @@
|
||||
extends Node3D
|
||||
|
||||
var open = false
|
||||
var sound_open = preload("res://Audio/drawer-open.wav")
|
||||
var sound_close = preload("res://Audio/drawer-close.wav")
|
||||
|
||||
func _on_static_body_3d_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
||||
print("Laatje!")
|
||||
$Kast/Drawer.position.z = abs($Kast/Drawer.position.z - 1.0)
|
||||
if open:
|
||||
$Kast/Drawer/DrawerSound.stream = sound_close
|
||||
else:
|
||||
$Kast/Drawer/DrawerSound.stream = sound_open
|
||||
open = !open
|
||||
$Kast/Drawer.position.z = abs($Kast/Drawer.position.z - 1.0)
|
||||
$Kast/Drawer/DrawerSound.playing = true
|
||||
|
||||
|
||||
func _on_sleutel_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
|
||||
@@ -13,6 +13,7 @@ func _on_lock_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
if get_node("../Player").has_key:
|
||||
$Deur.visible = false
|
||||
$Lock.visible = false
|
||||
$Lock/DeurOpen.playing = true
|
||||
|
||||
|
||||
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
|
||||
Reference in New Issue
Block a user