inventory soort van
This commit is contained in:
@@ -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
|
||||
@@ -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()
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user