tojam20-elevator/scenes/button_panel.gd
Jennie Robinson Faber fae69c4816 Add virtua hand lighting up floor buttons!
- hand sweeps down the button panel at game start
- button panel now spawns its floor buttons procedurally via button_panel.gd
- elevator_panel waits for the new intro_finished signal before starting floor 1
- removes the stray ShaftStrip from hud.tscn
- cleaned up timing but henry will probably want to tune further
2026-05-16 19:31:39 +01:00

18 lines
531 B
GDScript

extends Node3D
const BUTTON_SCENE = preload("res://scenes/floor_button.tscn")
const BUTTON_COUNT := 10
const Y_TOP := 8.49
const Y_BOTTOM := -4.36
@onready var _container: Node3D = $FloorButtons
func _ready() -> void:
var spacing = (Y_TOP - Y_BOTTOM) / float(BUTTON_COUNT - 1)
for i in range(BUTTON_COUNT):
var btn = BUTTON_SCENE.instantiate()
btn.name = "%02d" % i
btn.position = Vector3(0, Y_BOTTOM + i * spacing, 0)
_container.add_child(btn)
var sprite: Sprite3D = btn.get_node("ButtonSprite")
sprite.frame = i