From ea38104ce01fc295a664ad38a4668fd916d0e8ab Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Mon, 15 Jan 2024 19:05:25 -0700 Subject: [PATCH] debug menu --- bootclick.gd | 7 +- bootclick.tscn | 10 +-- levels/debug.gd | 51 +++++++++++ levels/debug.tscn | 77 +++++++++++++++++ levels/scene.gd | 61 +++++++++++++ levels/scene.tscn | 88 +++++++++++++++++++ levels/soundtest.gd | 112 ++++++++++++++++++++++++ levels/soundtest.tscn | 196 ++++++++++++++++++++++++++++++++++++++++++ levels/tmenu.gd | 51 +++++++++++ levels/tmenu.tscn | 77 +++++++++++++++++ project.godot | 17 ++++ title.gd | 8 +- 12 files changed, 743 insertions(+), 12 deletions(-) create mode 100644 levels/debug.gd create mode 100644 levels/debug.tscn create mode 100644 levels/scene.gd create mode 100644 levels/scene.tscn create mode 100644 levels/soundtest.gd create mode 100644 levels/soundtest.tscn create mode 100644 levels/tmenu.gd create mode 100644 levels/tmenu.tscn diff --git a/bootclick.gd b/bootclick.gd index 6191954..b2e8878 100644 --- a/bootclick.gd +++ b/bootclick.gd @@ -9,8 +9,9 @@ const savegame = preload("res://save.gd") func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) - OS.get_data_dir().rsplit("/", true, 7)[2] - #loadgame.new() + #OS.get_data_dir().rsplit("/", true, 7)[2] + loadgame.new() + print(OS.get_processor_name()) #pass # Replace with function body. #add_child(title) @@ -24,7 +25,7 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if !Global.sk && (event is InputEventMouseButton || Input.is_key_pressed(KEY_ENTER) || Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_Y) || Input.is_joy_button_pressed(0,JOY_BUTTON_A) || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK) || Input.is_joy_button_pressed(0,JOY_BUTTON_START) || Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) || Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_SHOULDER)): + if !Global.sk && (event is InputEventMouseButton || Input.is_action_pressed("ui_accept")): #print("Mouse Click/Unclick at: ", event.position) _title() diff --git a/bootclick.tscn b/bootclick.tscn index a7e7015..d51d7e7 100644 --- a/bootclick.tscn +++ b/bootclick.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=4 format=3 uid="uid://bcpnv8mhi4v57"] +[gd_scene load_steps=4 format=3 uid="uid://yumpp02h7ma2"] [ext_resource type="Script" path="res://bootclick.gd" id="1_52bti"] [ext_resource type="PackedScene" path="res://selftest.tscn" id="3_jtnh5"] @@ -13,12 +13,12 @@ script = ExtResource("1_52bti") [node name="Label" type="Label" parent="."] layout_mode = 0 -offset_left = 105.0 +offset_left = 290.0 offset_top = 258.0 -offset_right = 453.0 -offset_bottom = 284.0 +offset_right = 949.0 +offset_bottom = 326.0 theme_override_font_sizes/font_size = 49 -text = "Press enter or a gamepad button to continue" +text = "Press enter or B to continue" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/levels/debug.gd b/levels/debug.gd new file mode 100644 index 0000000..829f86f --- /dev/null +++ b/levels/debug.gd @@ -0,0 +1,51 @@ +extends Control +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + $"VBoxContainer/Scene Selector".grab_focus() + +# 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_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 + + + +func _on_scene_selector_pressed(): + get_tree().change_scene_to_file("res://levels/scene.tscn") + + +func _on_sound_test_pressed(): + get_tree().change_scene_to_file("res://levels/soundtest.tscn") + + +func _on_back_pressed(): + get_tree().change_scene_to_file("res://levels/tmenu.tscn") diff --git a/levels/debug.tscn b/levels/debug.tscn new file mode 100644 index 0000000..3952aa9 --- /dev/null +++ b/levels/debug.tscn @@ -0,0 +1,77 @@ +[gd_scene load_steps=7 format=3 uid="uid://brrta1s63r2q2"] + +[ext_resource type="Script" path="res://levels/debug.gd" id="1_gm5qw"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_l51wy"] +[ext_resource type="Script" path="res://nebula.gd" id="3_0jyxj"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821nm"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6u0xs"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r2qrn"] +bg_color = Color(0, 0.8, 0, 1) + +[node name="Debug" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_gm5qw") + +[node name="nebula" type="VideoStreamPlayer" parent="."] +layout_mode = 0 +offset_right = 640.0 +offset_bottom = 368.0 +scale = Vector2(2, 1.96) +stream = ExtResource("2_l51wy") +autoplay = true +script = ExtResource("3_0jyxj") + +[node name="Game name" type="Label" parent="."] +layout_mode = 0 +offset_left = 339.0 +offset_top = 61.0 +offset_right = 991.0 +offset_bottom = 207.0 +theme_override_font_sizes/font_size = 106 +text = "Debug Menu" + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -129.5 +offset_top = -362.0 +offset_right = 129.5 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="Scene Selector" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_821nm") +text = "Scene Selector" + +[node name="Sound Test" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Sound Test" + +[node name="Back" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") +text = "Back" + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="VBoxContainer/Scene Selector" to="." method="_on_scene_selector_pressed"] +[connection signal="pressed" from="VBoxContainer/Sound Test" to="." method="_on_sound_test_pressed"] +[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/levels/scene.gd b/levels/scene.gd new file mode 100644 index 0000000..c6ee77d --- /dev/null +++ b/levels/scene.gd @@ -0,0 +1,61 @@ +extends Control +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + $"VBoxContainer/Disclaimer".grab_focus() + +# 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_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 + + + + + + +func _on_back_pressed(): + get_tree().change_scene_to_file("res://levels/debug.tscn") + +func _on_credits_pressed(): + get_tree().change_scene_to_file("res://levels/credits.tscn") + + +func _on_wip_pressed(): + get_tree().change_scene_to_file("res://backgounds/wip.tscn") + + +func _on_results_pressed(): + get_tree().change_scene_to_file("res://backgounds/result.tscn") + + +func _on_disclaimer_pressed(): + get_tree().change_scene_to_file("res://backgounds/disclaimer.tscn") diff --git a/levels/scene.tscn b/levels/scene.tscn new file mode 100644 index 0000000..cf6d32f --- /dev/null +++ b/levels/scene.tscn @@ -0,0 +1,88 @@ +[gd_scene load_steps=6 format=3 uid="uid://duyxejhnys1l4"] + +[ext_resource type="Script" path="res://levels/scene.gd" id="1_hxcrn"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_nvftm"] +[ext_resource type="Script" path="res://nebula.gd" id="3_6sds4"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6u0xs"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r2qrn"] +bg_color = Color(0, 0.8, 0, 1) + +[node name="Scene" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_hxcrn") + +[node name="nebula" type="VideoStreamPlayer" parent="."] +layout_mode = 0 +offset_right = 640.0 +offset_bottom = 368.0 +scale = Vector2(2, 1.96) +stream = ExtResource("2_nvftm") +autoplay = true +script = ExtResource("3_6sds4") + +[node name="Game name" type="Label" parent="."] +layout_mode = 0 +offset_left = 496.0 +offset_top = 3.0 +offset_right = 790.0 +offset_bottom = 73.0 +theme_override_font_sizes/font_size = 40 +text = "Scene selector" + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -129.5 +offset_top = -362.0 +offset_right = 129.5 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="Disclaimer" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Disclaimer" + +[node name="Results" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Result Screen" + +[node name="Credits" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Credits" + +[node name="WIP" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Work in Progress" + +[node name="Back" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") +text = "Back" + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="VBoxContainer/Disclaimer" to="." method="_on_disclaimer_pressed"] +[connection signal="pressed" from="VBoxContainer/Results" to="." method="_on_results_pressed"] +[connection signal="pressed" from="VBoxContainer/Credits" to="." method="_on_credits_pressed"] +[connection signal="pressed" from="VBoxContainer/WIP" to="." method="_on_wip_pressed"] +[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/levels/soundtest.gd b/levels/soundtest.gd new file mode 100644 index 0000000..beb4cb6 --- /dev/null +++ b/levels/soundtest.gd @@ -0,0 +1,112 @@ +extends Control +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + $"BoxContainer/VBoxContainer/Title Screen".grab_focus() + +# 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_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 + + + + +func _on_back_pressed(): + get_tree().change_scene_to_file("res://levels/debug.tscn") + + +func _on_title_screen_pressed(): + pass # Replace with function body. + +func _on_credits_1_pressed(): + pass # Replace with function body. + + +func _on_credits_2_pressed(): + pass # Replace with function body. + + +func _on_credits_3_pressed(): + pass # Replace with function body. + + +func _on_disclaimer_settings_stores_pressed(): + pass # Replace with function body. + + +func _on_testrooms_pressed(): + pass # Replace with function body. + + +func _on_friendly_challenge_pressed(): + pass # Replace with function body. + + +func _on_school_nursery_pressed(): + pass # Replace with function body. + + +func _on_overworld_ceres_pressed(): + pass # Replace with function body. + + +func _on_boss_fight_ceres_pressed(): + pass # Replace with function body. + + +func _on_overworld_earth_pressed(): + pass # Replace with function body. + + +func _on_the_zubmarine_zone_pressed(): + pass # Replace with function body. + + +func _on_radioactive_desert_pressed(): + pass # Replace with function body. + + +func _on_boss_fight_earth_pressed(): + pass # Replace with function body. + + +func _on_dungeon_of_destruction_pressed(): + pass # Replace with function body. + + +func _on_final_boss_fight_pressed(): + pass # Replace with function body. + + +func _on_ending_theme_pressed(): + pass # Replace with function body. diff --git a/levels/soundtest.tscn b/levels/soundtest.tscn new file mode 100644 index 0000000..eb90a28 --- /dev/null +++ b/levels/soundtest.tscn @@ -0,0 +1,196 @@ +[gd_scene load_steps=7 format=3 uid="uid://chg6qe1fijkh3"] + +[ext_resource type="Script" path="res://levels/soundtest.gd" id="1_3bg6p"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_abtft"] +[ext_resource type="Script" path="res://nebula.gd" id="3_c33nl"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cprm3"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_alctd"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0dqsq"] +bg_color = Color(0, 0.8, 0, 1) + +[node name="Soundtest" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_3bg6p") + +[node name="nebula" type="VideoStreamPlayer" parent="."] +layout_mode = 0 +offset_right = 640.0 +offset_bottom = 368.0 +scale = Vector2(2, 1.96) +stream = ExtResource("2_abtft") +autoplay = true +script = ExtResource("3_c33nl") + +[node name="Game name" type="Label" parent="."] +layout_mode = 0 +offset_left = 496.0 +offset_top = 3.0 +offset_right = 790.0 +offset_bottom = 73.0 +theme_override_font_sizes/font_size = 40 +text = "Sound Test" + +[node name="Stop" type="Label" parent="."] +layout_mode = 0 +offset_left = 5.0 +offset_top = 672.0 +offset_right = 444.0 +offset_bottom = 708.0 +theme_override_font_sizes/font_size = 22 +text = "Press X or Spacebar to stop music playback" + +[node name="BoxContainer" type="BoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -640.0 +offset_top = -419.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="VBoxContainer" type="VBoxContainer" parent="BoxContainer"] +layout_mode = 2 + +[node name="Title Screen" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3") +text = "Title Screen: X-Force Theme" + +[node name="Disclaimer, Settings, Stores" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3") +text = "Disclaimer, Settings, Stores" + +[node name="Testrooms" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Testrooms" + +[node name="Friendly challenge" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Friendly challenge" + +[node name="School nursery" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "School nursery" + +[node name="Overworld (Ceres)" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Overworld (Ceres)" + +[node name="Boss fight (Ceres)" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Boss fight (Ceres)" + +[node name="Overworld (Earth)" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Overworld (Earth)" + +[node name="The Zubmarine Zone" type="Button" parent="BoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "The Zubmarine Zone" + +[node name="VBoxContainer2" type="VBoxContainer" parent="BoxContainer"] +layout_mode = 2 + +[node name="Radioactive Desert" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Radioactive Desert" + +[node name="Boss Fight (Earth)" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Boss Fight (Earth)" + +[node name="Dungeon of Destruction" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Dungeon of Destruction" + +[node name="Final Boss Fight" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Final Boss Fight" + +[node name="Ending Theme" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Ending Theme" + +[node name="Credits 1" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Credits 1" + +[node name="Credits 2" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Credits 2" + +[node name="Credits 3" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Credits 3" + +[node name="Back" type="Button" parent="BoxContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Back" + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Title Screen" to="." method="_on_title_screen_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Disclaimer, Settings, Stores" to="." method="_on_disclaimer_settings_stores_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Testrooms" to="." method="_on_testrooms_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Friendly challenge" to="." method="_on_friendly_challenge_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/School nursery" to="." method="_on_school_nursery_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Overworld (Ceres)" to="." method="_on_overworld_ceres_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Boss fight (Ceres)" to="." method="_on_boss_fight_ceres_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/Overworld (Earth)" to="." method="_on_overworld_earth_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer/The Zubmarine Zone" to="." method="_on_the_zubmarine_zone_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Radioactive Desert" to="." method="_on_radioactive_desert_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Boss Fight (Earth)" to="." method="_on_boss_fight_earth_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Dungeon of Destruction" to="." method="_on_dungeon_of_destruction_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Final Boss Fight" to="." method="_on_final_boss_fight_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Ending Theme" to="." method="_on_ending_theme_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Credits 1" to="." method="_on_credits_1_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Credits 2" to="." method="_on_credits_2_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Credits 3" to="." method="_on_credits_3_pressed"] +[connection signal="pressed" from="BoxContainer/VBoxContainer2/Back" to="." method="_on_back_pressed"] diff --git a/levels/tmenu.gd b/levels/tmenu.gd new file mode 100644 index 0000000..8fe0de2 --- /dev/null +++ b/levels/tmenu.gd @@ -0,0 +1,51 @@ +extends Control +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + $VBoxContainer/Start.grab_focus() + +# 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_key_pressed(KEY_ENTER) || Input.is_joy_button_pressed(0,JOY_BUTTON_B): + #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 + + +func _on_start_pressed(): + _level() + #pass # Replace with function body. + + +func _on_debug_pressed(): + get_tree().change_scene_to_file("res://levels/debug.tscn") + + +func _on_exit_pressed(): + get_tree().quit() + #pass # Replace with function body. diff --git a/levels/tmenu.tscn b/levels/tmenu.tscn new file mode 100644 index 0000000..81677fd --- /dev/null +++ b/levels/tmenu.tscn @@ -0,0 +1,77 @@ +[gd_scene load_steps=7 format=3 uid="uid://s8ttuboef06k"] + +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="1_33b4o"] +[ext_resource type="Script" path="res://levels/tmenu.gd" id="1_w3aym"] +[ext_resource type="Script" path="res://nebula.gd" id="2_x35ws"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821nm"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6u0xs"] +bg_color = Color(0, 0.8, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r2qrn"] +bg_color = Color(0, 0.8, 0, 1) + +[node name="Tmenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_w3aym") + +[node name="nebula" type="VideoStreamPlayer" parent="."] +layout_mode = 0 +offset_right = 640.0 +offset_bottom = 368.0 +scale = Vector2(2, 1.96) +stream = ExtResource("1_33b4o") +autoplay = true +script = ExtResource("2_x35ws") + +[node name="Game name" type="Label" parent="."] +layout_mode = 0 +offset_left = 31.0 +offset_top = 113.0 +offset_right = 1237.0 +offset_bottom = 243.0 +theme_override_font_sizes/font_size = 95 +text = "Midori in the Magic School" + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -129.5 +offset_top = -362.0 +offset_right = 129.5 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="Start" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_821nm") +text = "Start" + +[node name="Debug" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs") +text = "Debug" + +[node name="Exit" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") +text = "Exit" + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"] +[connection signal="pressed" from="VBoxContainer/Debug" to="." method="_on_debug_pressed"] +[connection signal="pressed" from="VBoxContainer/Exit" to="." method="_on_exit_pressed"] diff --git a/project.godot b/project.godot index b9ece7b..9dc41f4 100644 --- a/project.godot +++ b/project.godot @@ -26,6 +26,23 @@ window/size/viewport_height=720 window/size/mode=3 window/stretch/mode="viewport" +[input] + +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":false,"script":null) +] +} +ui_cancel={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +] +} + [rendering] renderer/rendering_method="gl_compatibility" diff --git a/title.gd b/title.gd index 6c16fc2..7397096 100644 --- a/title.gd +++ b/title.gd @@ -26,11 +26,11 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_key_pressed(KEY_ENTER) || Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_B)): + if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_action_pressed("ui_accept")): #print("Mouse Click/Unclick at: ", event.position) - _level() - #print("There are not game levels at the moment") - elif (Time.get_ticks_msec() - wait) >= 1000 && (Input.is_key_pressed(KEY_ESCAPE) || Input.is_key_pressed(KEY_Z) || Input.is_joy_button_pressed(0,JOY_BUTTON_A)): + get_tree().change_scene_to_file("res://levels/tmenu.tscn") + #_level() + elif (Time.get_ticks_msec() - wait) >= 1000 && (Input.is_action_pressed("ui_cancel")): get_tree().quit() func _level():