inventory soort van

This commit is contained in:
2023-02-10 00:25:46 +01:00
parent 922d36fe3c
commit 250ab93c15
8 changed files with 106 additions and 49 deletions
+8
View File
@@ -0,0 +1,8 @@
extends SubViewportContainer
func add_item(mesh: Node):
$"SubViewport/Camera3D/Item Position".add_child(mesh)
func _process(delta):
if $"SubViewport/Camera3D/Item Position".get_child_count() > 0:
$"SubViewport/Camera3D/Item Position".get_child(0).rotation.y += delta
+12
View File
@@ -28,6 +28,18 @@ func message(msg: String, title: String = ""):
func _process(delta):
timer += delta
#$"Control/HFlowContainer/SubViewportContainer/SubViewport/Camera3D/Item Position".get_child(0).rotation.y += delta
#$Control/SubViewportContainer/SubViewport/Camera3D/sleutel.rotation.y += delta
func add_item(mesh: Node):
var subviewport = preload("res://GUI-item.tscn").instantiate()
$Control/HFlowContainer.add_child(subviewport)
subviewport.add_item(mesh)
print_tree()
func clear_items():
for child in $Control/HFlowContainer.get_children():
child.queue_free()
func _on_close_pressed(node):
node.get_parent().queue_free()
+1
View File
@@ -4,6 +4,7 @@ var combination
func _ready():
combination = randi() % 10000
print(combination)
$".."/CombiCode.mesh.text = "%04d" % combination #met leading 0'en
func get_number():
+1
View File
@@ -20,3 +20,4 @@ func _on_sleutel_input_event(_camera, event, _position, _normal, _shape_idx):
$Kast/Drawer/Sleutel.visible = false
get_node("../Player").has_key = true
get_node("../Player/Pickup").playing = true
$"../Gui".add_item(preload("res://Objects/sleutel.tscn").instantiate())
+1
View File
@@ -14,6 +14,7 @@ func _on_lock_input_event(_camera, event, _position, _normal, _shape_idx):
$Deur.visible = false
$Lock.visible = false
$Lock/DeurOpen.playing = true
$"../Gui".clear_items()
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):