68 lines
1.5 KiB
GDScript
68 lines
1.5 KiB
GDScript
extends Control
|
|
|
|
var display_text = """
|
|
SYSTEM INITIALIZATION...
|
|
---------------------------------------
|
|
PLACEHOLDER BOOT SEQUENCE
|
|
COPYRIGHT PLACEHOLDER
|
|
|
|
> CPU:
|
|
> MEMORY:
|
|
> STORAGE:
|
|
> GPU:
|
|
|
|
>> WARNING:
|
|
>> RECOMMENDED ACTION:
|
|
|
|
SYSTEM READY.
|
|
PRESS START TO INITIATE.
|
|
|
|
"""
|
|
|
|
var current_text = ""
|
|
var char_index = 0
|
|
var typing_speed = 0.05
|
|
var fast_typing_speed = 0.005
|
|
|
|
func _ready():
|
|
for hbox in $VBoxContainer/VBoxContainer3.get_children():
|
|
hbox.visible = false
|
|
|
|
_start_typing()
|
|
|
|
func _process(_delta: float) -> void:
|
|
if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("click"):
|
|
typing_speed = fast_typing_speed
|
|
else:
|
|
typing_speed = 0.05
|
|
|
|
func _start_typing() -> void:
|
|
current_text = ""
|
|
char_index = 0
|
|
_update_text()
|
|
|
|
func _update_text() -> void:
|
|
if char_index < display_text.length():
|
|
current_text += display_text[char_index]
|
|
$VBoxContainer/VBoxContainer2/Label.text = current_text
|
|
char_index += 1
|
|
await get_tree().create_timer(typing_speed).timeout
|
|
_update_text()
|
|
else:
|
|
_show_menu_options()
|
|
|
|
func _show_menu_options() -> void:
|
|
for hbox in $VBoxContainer/VBoxContainer3.get_children():
|
|
hbox.visible = true
|
|
|
|
|
|
func _on_start_button_pressed() -> void:
|
|
get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn")
|
|
|
|
func _on_credits_button_pressed() -> void:
|
|
get_tree().change_scene_to_file("res://menu/main_menu/CreditsScene.tscn")
|
|
|
|
func _on_quit_button_pressed() -> void:
|
|
$VBoxContainer/VBoxContainer2/Label.text += "\nLogging out!"
|
|
await get_tree().create_timer(0.5).timeout
|
|
get_tree().quit()
|