21f0750a74
en een worst zelfs twee
25 lines
919 B
GDScript
25 lines
919 B
GDScript
extends Node3D
|
|
|
|
var combination
|
|
|
|
func _ready():
|
|
combination = randi() % 10000
|
|
$".."/CombiCode.mesh.text = "%04d" % combination #met leading 0'en
|
|
|
|
func get_number():
|
|
return 1000 * $Body/"1"/Cylinder/StaticBody3D.number + \
|
|
100 * $Body/"2"/Cylinder/StaticBody3D.number + \
|
|
10 * $Body/"3"/Cylinder/StaticBody3D.number + \
|
|
$Body/"4"/Cylinder/StaticBody3D.number
|
|
|
|
func _on_static_body_3d_input_event(camera, event, position, normal, shape_idx):
|
|
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
|
$Body/Knop/Audio.playing = true
|
|
if get_number() == combination:
|
|
$".."/Room/Doorframe/Door.visible = false
|
|
$".."/Room/Doorframe/Door/Deur.set_collision_layer(0)
|
|
$"../IndirectLightDoor".visible = true
|
|
$"../Einde/Wincamera/AudioStreamPlayer3D".playing = true
|
|
$"../Einde/Wincamera/AudioStreamPlayer3D2".playing = true
|
|
$"../Einde/Wincamera/AudioStreamPlayer3D3".playing = true
|