pedestals light up
This commit is contained in:
parent
4a564dc3f5
commit
220ca2886f
5 changed files with 44 additions and 5 deletions
|
|
@ -6,7 +6,11 @@ signal broadcast(command : String)
|
|||
@export_group("Variables")
|
||||
@export var level_tick : float = 1 # how often to run a command
|
||||
@export var level_time : float = 10 # the amoutn of time allowed for the level
|
||||
|
||||
var tick_timer : float = 0
|
||||
var room_started : bool = false
|
||||
var current_tick = 0
|
||||
@export var pedestal_off_mat : Material
|
||||
@export var pedestal_on_mat : Material
|
||||
|
||||
@export_group("Node References")
|
||||
@export var gui : Control
|
||||
|
|
@ -14,16 +18,37 @@ signal broadcast(command : String)
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
for i in pedestals.size():
|
||||
pedestals[i].mesh.mesh = pedestals[i].mesh.mesh.duplicate()
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("debug_start"):
|
||||
start_room()
|
||||
|
||||
if room_started and current_tick < level_time:
|
||||
tick_timer += delta
|
||||
|
||||
if tick_timer > level_tick:
|
||||
tick_timer = 0
|
||||
current_tick += 1
|
||||
print("Tick: " + str(current_tick))
|
||||
for i in pedestals.size():
|
||||
if i+1 == current_tick:
|
||||
pedestals[i].mesh.mesh.material = pedestal_on_mat
|
||||
else:
|
||||
pass
|
||||
#pedestals[i].mesh.material
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func start_room():
|
||||
print("START")
|
||||
room_started = true
|
||||
|
||||
# open door
|
||||
# start timers
|
||||
# start running commands
|
||||
|
|
@ -32,6 +57,9 @@ func start_room():
|
|||
|
||||
func reset_room():
|
||||
# run if timer expires, resets puzzle
|
||||
# replace door
|
||||
# put player back in start room
|
||||
# reset timers
|
||||
pass
|
||||
|
||||
func finish_room():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue