23 lines
724 B
GDScript
23 lines
724 B
GDScript
extends Control
|
|
|
|
const LEVEL_5_ROOMS = preload("res://levels/level_5rooms.tscn")
|
|
const LEVEL_3_ROOMS = preload("res://levels/level_3_rooms.tscn")
|
|
const LEVEL_PLATFORMER = preload("res://levels/level_platformer.tscn")
|
|
const LEVEL_SEMAPHORE_LIGHTS = preload("res://levels/level_semaphore_lights.tscn")
|
|
|
|
@onready var items_container: VBoxContainer = $CenterContainer/ItemsContainer
|
|
|
|
var levels = {
|
|
"Semaphore": LEVEL_3_ROOMS,
|
|
"Semaphore - Lights": LEVEL_SEMAPHORE_LIGHTS,
|
|
"5 rooms": LEVEL_5_ROOMS,
|
|
"Infinite fall": LEVEL_PLATFORMER
|
|
}
|
|
|
|
func _ready() -> void:
|
|
for key in levels:
|
|
var b = Button.new()
|
|
items_container.add_child(b)
|
|
b.text = key
|
|
b.pressed.connect(func(): get_tree().change_scene_to_packed(levels[key]))
|