32 lines
619 B
GDScript
32 lines
619 B
GDScript
extends Node3D
|
|
|
|
|
|
var exits: Array = [false, false, false, false]
|
|
|
|
|
|
func _ready() -> void:
|
|
exits = [
|
|
randi() % 2 == 0,
|
|
randi() % 2 == 0,
|
|
randi() % 2 == 0,
|
|
randi() % 2 == 0,
|
|
]
|
|
|
|
update()
|
|
|
|
func update() -> void:
|
|
var i = 0
|
|
for exit in exits:
|
|
if not exit:
|
|
continue
|
|
if i == 0: #n
|
|
$n.get_surface_override_material(0).albedo_color = Color.GREEN
|
|
if i == 1: #s
|
|
$s.get_surface_override_material(0).albedo_color = Color.GREEN
|
|
if i == 2: #w
|
|
$w.get_surface_override_material(0).albedo_color = Color.GREEN
|
|
if i == 3: #e
|
|
$e.get_surface_override_material(0).albedo_color = Color.GREEN
|
|
|
|
i += 1
|