Random combination code
This commit is contained in:
+5
-2
@@ -1,7 +1,10 @@
|
||||
extends Node3D
|
||||
|
||||
var combination
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
combination = randi() % 10000
|
||||
$".."/CombiCode.mesh.text = str(combination)
|
||||
|
||||
func get_number():
|
||||
return 1000 * $Body/"1"/Cylinder/StaticBody3D.number + \
|
||||
@@ -13,6 +16,6 @@ func get_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() == 1984:
|
||||
if get_number() == combination:
|
||||
$Lamp.light_color = Color.LIGHT_GREEN
|
||||
$Congratulations.playing = true
|
||||
|
||||
Reference in New Issue
Block a user