midori-school/levels/ui/testrooms.gd

59 lines
1.5 KiB
GDScript3
Raw Normal View History

2024-01-16 13:58:17 +01:00
extends Control
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
2024-01-20 11:38:12 +01:00
$"VBoxContainer/Testspawn".grab_focus()
2024-01-16 13:58:17 +01:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _level():
# This is like autoloading the scene, only
# it happens after already loading the main scene.
get_tree().change_scene_to_file("res://backgounds/disclaimer.tscn")
#Global.live = 1
#Global.gamelevel = randi() % 3
#if Global.gamelevel == 0:
# get_tree().change_scene_to_file("res://backgounds/galaxy.tscn")
#elif Global.gamelevel == 1:
# get_tree().change_scene_to_file("res://backgounds/wormhole.tscn")
#else:
# get_tree().change_scene_to_file("res://backgounds/abstract.tscn")
#get_tree().root.add_child(title)
#get_tree().root.remove_child(boot)
#boot.queue_free()
func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
_on_back_pressed()
#print("Mouse Click/Unclick at: ", event.position)
# if highlighted == 1:
# _on_debug_pressed()
# if highlighted == 2:
# _on_exit_pressed()
# else:
# _on_start_pressed()
# elif Input.is_action_pressed("ui_up"):
# focus_next
2024-01-20 11:38:12 +01:00
2024-01-16 13:58:17 +01:00
func _on_back_pressed():
2024-01-20 11:38:12 +01:00
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
func _on_testspawn_pressed():
Global.dplace = [0, 2, 1]
2024-01-20 14:58:29 +01:00
Global.live = 1
2024-01-20 11:38:12 +01:00
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
2024-01-16 13:58:17 +01:00
2024-01-20 11:38:12 +01:00
func _on_testboss_pressed():
Global.dplace = [0, 1, 1]
2024-01-20 14:58:29 +01:00
Global.live = 1
2024-01-20 11:38:12 +01:00
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")