From f145708e2c70ce1abacb7b7b1a57a2335db39dcb Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Tue, 16 Jan 2024 05:58:51 -0700 Subject: [PATCH] new release --- Label2.gd | 2 +- backgounds/Label3.gd | 3 +- backgounds/abstract.gd | 11 +-- backgounds/galaxy.gd | 11 +-- backgounds/radio.gd | 7 +- backgounds/supernova.gd | 7 +- backgounds/wormhole.gd | 11 +-- global.gd | 4 + levels/Version.gd | 7 ++ levels/abstract.gd | 2 +- levels/bottomhud.tscn | 11 +-- levels/credits.gd | 8 +- levels/debug.gd | 6 +- levels/debug.tscn | 6 +- levels/galaxy.gd | 2 +- levels/musictest.gd | 102 ++++++++++++++++++++++ levels/musictest.tscn | 167 ++++++++++++++++++++++++++++++++++++ levels/scene.gd | 7 +- levels/scene.tscn | 6 +- levels/sfxtest.gd | 52 +++++++++++ levels/sfxtest.tscn | 91 ++++++++++++++++++++ levels/soundtest.gd | 59 ++----------- levels/soundtest.tscn | 122 +++++--------------------- levels/tmenu.gd | 2 +- levels/tmenu.tscn | 6 +- levels/wormhole.gd | 2 +- bootclick.gd => main.gd | 4 +- bootclick.tscn => main.tscn | 24 +++--- project.godot | 2 +- title.gd | 8 +- 30 files changed, 539 insertions(+), 213 deletions(-) create mode 100644 levels/Version.gd create mode 100644 levels/musictest.gd create mode 100644 levels/musictest.tscn create mode 100644 levels/sfxtest.gd create mode 100644 levels/sfxtest.tscn rename bootclick.gd => main.gd (81%) rename bootclick.tscn => main.tscn (52%) diff --git a/Label2.gd b/Label2.gd index f1ca277..783a4c2 100644 --- a/Label2.gd +++ b/Label2.gd @@ -1,6 +1,6 @@ extends Label var housefreedom -func _process(delta: float) -> void: +func _ready(): housefreedom = OS.get_processor_name().contains("AMD Custom APU") && OS.get_processor_name().contains("0405") if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0: Global.sk = true diff --git a/backgounds/Label3.gd b/backgounds/Label3.gd index 2e72a36..aa93194 100644 --- a/backgounds/Label3.gd +++ b/backgounds/Label3.gd @@ -6,7 +6,8 @@ func _ready(): previoustime = int(Global.levelmax[Global.gamelevel]) if Global.time < previoustime && Global.live == 3: Global.levelmax[Global.gamelevel] = str(Global.time) - savegame.new() + if !Global.debug: + savegame.new() var sec = float(Global.time / 1000) var msec = Global.time - (sec*1000) var bsec = float(previoustime / 1000) diff --git a/backgounds/abstract.gd b/backgounds/abstract.gd index 2ae9221..73688d6 100644 --- a/backgounds/abstract.gd +++ b/backgounds/abstract.gd @@ -14,10 +14,7 @@ func _ready(): func _process(delta): if Time.get_ticks_msec() - Global.wait > Global.timelimit: Global.live = 2 - if Global.live == 1 && (Time.get_ticks_msec() - Global.wait) >= 1000 && (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_A)): - #print("Mouse Click/Unclick at: ", event.position) - _title() - if Global.live == 0: + if Global.live == 0 || Input.is_action_just_pressed("ui_cancel"): _title() elif Global.live == 2: _crash() @@ -28,12 +25,16 @@ func _process(delta): func _title(): # This is like autoloading the scene, only # it happens after already loading the main scene. - get_tree().root.remove_child(abstract) + get_tree().root.remove_child(abstract) + if Global.debug: + get_tree().change_scene_to_file("res://levels/scene.tscn") + else: get_tree().change_scene_to_file("res://title.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) #boot.queue_free() + func _crash(): # This is like autoloading the scene, only # it happens after already loading the main scene. diff --git a/backgounds/galaxy.gd b/backgounds/galaxy.gd index c92a61d..60918a3 100644 --- a/backgounds/galaxy.gd +++ b/backgounds/galaxy.gd @@ -14,10 +14,7 @@ func _ready(): func _process(delta): if Time.get_ticks_msec() - Global.wait > Global.timelimit: Global.live = 2 - if Global.live == 1 && (Time.get_ticks_msec() - Global.wait) >= 1000 && (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_A)): - #print("Mouse Click/Unclick at: ", event.position) - _title() - if Global.live == 0: + if Global.live == 0 || Input.is_action_just_pressed("ui_cancel"): _title() elif Global.live == 2: _crash() @@ -28,12 +25,16 @@ func _process(delta): func _title(): # This is like autoloading the scene, only # it happens after already loading the main scene. - get_tree().root.remove_child(galaxy) + get_tree().root.remove_child(galaxy) + if Global.debug: + get_tree().change_scene_to_file("res://levels/scene.tscn") + else: get_tree().change_scene_to_file("res://title.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) #boot.queue_free() + func _crash(): # This is like autoloading the scene, only # it happens after already loading the main scene. diff --git a/backgounds/radio.gd b/backgounds/radio.gd index 98ccc87..b8232fc 100644 --- a/backgounds/radio.gd +++ b/backgounds/radio.gd @@ -6,7 +6,7 @@ var wait func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) add_child(crash) - var titlemusic = load("res://sfx/complete.ogg") + var titlemusic = load(Global.sfxtracks[2]) crash.stream = titlemusic crash.play(0) wait = Time.get_ticks_msec() @@ -19,13 +19,16 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_joy_button_pressed(0,JOY_BUTTON_A) || Input.is_key_pressed(KEY_ENTER)): + if Input.is_action_just_pressed("ui_accept"): #print("Mouse Click/Unclick at: ", event.position) _title() func _title(): # This is like autoloading the scene, only # it happens after already loading the main scene. + if Global.debug: + get_tree().change_scene_to_file("res://levels/scene.tscn") + else: get_tree().change_scene_to_file("res://title.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) diff --git a/backgounds/supernova.gd b/backgounds/supernova.gd index 248ae9d..9364d88 100644 --- a/backgounds/supernova.gd +++ b/backgounds/supernova.gd @@ -6,7 +6,7 @@ var wait func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) add_child(crash) - var titlemusic = load("res://sfx/crash.ogg") + var titlemusic = load(Global.sfxtracks[1]) crash.stream = titlemusic crash.play(0) wait = Time.get_ticks_msec() @@ -19,13 +19,16 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_key_pressed(KEY_ENTER)): + if Input.is_action_just_pressed("ui_accept"): #print("Mouse Click/Unclick at: ", event.position) _title() func _title(): # This is like autoloading the scene, only # it happens after already loading the main scene. + if Global.debug: + get_tree().change_scene_to_file("res://levels/scene.tscn") + else: get_tree().change_scene_to_file("res://title.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) diff --git a/backgounds/wormhole.gd b/backgounds/wormhole.gd index c994731..431b963 100644 --- a/backgounds/wormhole.gd +++ b/backgounds/wormhole.gd @@ -14,10 +14,7 @@ func _ready(): func _process(delta): if Time.get_ticks_msec() - Global.wait > Global.timelimit: Global.live = 2 - if Global.live == 1 && (Time.get_ticks_msec() - Global.wait) >= 1000 && (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_A)): - #print("Mouse Click/Unclick at: ", event.position) - _title() - if Global.live == 0: + if Global.live == 0 || Input.is_action_just_pressed("ui_cancel"): _title() elif Global.live == 2: _crash() @@ -28,12 +25,16 @@ func _process(delta): func _title(): # This is like autoloading the scene, only # it happens after already loading the main scene. - get_tree().root.remove_child(wormhole) + get_tree().root.remove_child(wormhole) + if Global.debug: + get_tree().change_scene_to_file("res://levels/scene.tscn") + else: get_tree().change_scene_to_file("res://title.tscn") #get_tree().root.add_child(title) #get_tree().root.remove_child(boot) #boot.queue_free() + func _crash(): # This is like autoloading the scene, only # it happens after already loading the main scene. diff --git a/global.gd b/global.gd index 30ca484..482f607 100644 --- a/global.gd +++ b/global.gd @@ -10,6 +10,10 @@ var hiscoresfile = "user://hiscores.save" var gamelevel var levelmax var firstrun +var musictracks = ["res://music/x-force.wav", "res://music/alien-bulls.wav", "res://music/eternity.wav", "res://music/truth.wav", "res://music/broken.wav", "res://music/maran.wav", "res://music/orion.wav", "res://music/rose.wav", "res://music/oskars.wav", "res://music/rock.wav", "res://music/yes-i-see.wav", "res://music/tekilla.wav", "res://music/sweetest-sin.wav"] +var sfxtracks = ["res://sfx/title.wav", "res://sfx/crash.ogg", "res://sfx/complete.ogg"] +var debug = false +var release = "R0.1.3-beta" var sk = false var xm = 0 var ym = 0 diff --git a/levels/Version.gd b/levels/Version.gd new file mode 100644 index 0000000..15cf202 --- /dev/null +++ b/levels/Version.gd @@ -0,0 +1,7 @@ +extends Label + +func _process(delta): + if Global.debug: + set_text("Debug Mode") + else: + set_text(Global.release) diff --git a/levels/abstract.gd b/levels/abstract.gd index fafae2e..bae2f4b 100644 --- a/levels/abstract.gd +++ b/levels/abstract.gd @@ -6,7 +6,7 @@ var bgsound := AudioStreamPlayer.new() func _ready(): add_child(bgsound) - var titlemusic = load("res://music/truth.wav") + var titlemusic = load(Global.musictracks[3]) bgsound.stream = titlemusic bgsound.play(0) #pass # Replace with function body. diff --git a/levels/bottomhud.tscn b/levels/bottomhud.tscn index 04241a5..a6244d7 100644 --- a/levels/bottomhud.tscn +++ b/levels/bottomhud.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://d31udhuuwrajn"] +[gd_scene load_steps=3 format=3 uid="uid://d31udhuuwrajn"] [ext_resource type="Script" path="res://fps.gd" id="1_15gcj"] +[ext_resource type="Script" path="res://levels/Version.gd" id="2_qx4dy"] [node name="Bottomhud" type="Control"] layout_mode = 3 @@ -18,10 +19,10 @@ offset_right = 45.0 offset_bottom = 720.0 script = ExtResource("1_15gcj") -[node name="Label" type="Label" parent="."] +[node name="Version" type="Label" parent="."] layout_mode = 0 -offset_left = 1191.0 +offset_left = 1166.0 offset_top = 691.0 -offset_right = 1271.0 +offset_right = 1246.0 offset_bottom = 714.0 -text = "R0.1.3-dev" +script = ExtResource("2_qx4dy") diff --git a/levels/credits.gd b/levels/credits.gd index bfd7e2c..d915a63 100644 --- a/levels/credits.gd +++ b/levels/credits.gd @@ -3,9 +3,9 @@ extends Node2D # Called when the node enters the scene tree for the first time. var bgsound := AudioStreamPlayer.new() -var song1 = load("res://music/yes-i-see.wav") -var song2 = load("res://music/tekilla.wav") -var song3 = load("res://music/sweetest-sin.wav") +var song1 = load(Global.musictracks[10]) +var song2 = load(Global.musictracks[11]) +var song3 = load(Global.musictracks[12]) var playstart = false var playindex = 0 @@ -51,6 +51,6 @@ func _complete(): func _input(event): # Mouse in viewport coordinates. - if bgsound.get_playback_position() > 1 && event is InputEventMouseButton || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_key_pressed(KEY_ENTER): + if Input.is_action_just_pressed("ui_accept"): #print("Mouse Click/Unclick at: ", event.position) _complete() diff --git a/levels/debug.gd b/levels/debug.gd index f266f47..9bf095f 100644 --- a/levels/debug.gd +++ b/levels/debug.gd @@ -1,6 +1,7 @@ extends Control func _ready(): - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + Global.debug = true $"VBoxContainer/Scene Selector".grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -9,7 +10,7 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if Input.is_action_pressed("ui_cancel"): + if Input.is_action_just_pressed("ui_cancel"): _on_back_pressed() #print("Mouse Click/Unclick at: ", event.position) # if highlighted == 1: @@ -34,4 +35,5 @@ func _on_sound_test_pressed(): func _on_back_pressed(): + Global.debug = false get_tree().change_scene_to_file("res://levels/tmenu.tscn") diff --git a/levels/debug.tscn b/levels/debug.tscn index 39eb60a..db86574 100644 --- a/levels/debug.tscn +++ b/levels/debug.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://vcmqr6ql7fg6"] +[gd_scene load_steps=8 format=3 uid="uid://vcmqr6ql7fg6"] [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"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_2y1er"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821nm"] bg_color = Color(0, 0.8, 0, 1) @@ -71,6 +72,9 @@ theme_override_font_sizes/font_size = 80 theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") text = "Back" +[node name="Bottomhud" parent="." instance=ExtResource("4_2y1er")] +layout_mode = 1 + [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"] diff --git a/levels/galaxy.gd b/levels/galaxy.gd index 12db15d..9526681 100644 --- a/levels/galaxy.gd +++ b/levels/galaxy.gd @@ -6,7 +6,7 @@ var bgsound := AudioStreamPlayer.new() func _ready(): add_child(bgsound) - var titlemusic = load("res://music/alien-bulls.wav") + var titlemusic = load(Global.musictracks[1]) bgsound.stream = titlemusic bgsound.play(0) #pass # Replace with function body. diff --git a/levels/musictest.gd b/levels/musictest.gd new file mode 100644 index 0000000..44ca253 --- /dev/null +++ b/levels/musictest.gd @@ -0,0 +1,102 @@ +extends Control + +var player := AudioStreamPlayer.new() + +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + add_child(player) + $"VBoxContainer/Title Screen".grab_focus() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _input(event): + # Mouse in viewport coordinates. + if Input.is_action_just_pressed("ui_cancel"): + _on_back_pressed() + if Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_X): + player.stop() + #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/soundtest.tscn") + + +func _on_title_screen_pressed(): + player.stream = load(Global.musictracks[0]) + player.play(0) + + +func _on_galaxy_pressed(): + player.stream = load(Global.musictracks[1]) + player.play(0) + + +func _on_wormhole_pressed(): + player.stream = load(Global.musictracks[2]) + player.play(0) + + +func _on_abstract_pressed(): + player.stream = load(Global.musictracks[3]) + player.play(0) + + +func _on_galaxy_2_pressed(): + player.stream = load(Global.musictracks[4]) + player.play(0) + + +func _on_lagoon_pressed(): + player.stream = load(Global.musictracks[5]) + player.play(0) + + +func _on_orion_pressed(): + player.stream = load(Global.musictracks[6]) + player.play(0) + + +func _on_space_pressed(): + player.stream = load(Global.musictracks[7]) + player.play(0) + + +func _on_stars_pressed(): + player.stream = load(Global.musictracks[8]) + player.play(0) + + +func _on_universe_pressed(): + player.stream = load(Global.musictracks[9]) + player.play(0) + + +func _on_credits_1_pressed(): + player.stream = load(Global.musictracks[10]) + player.play(0) + + +func _on_credits_2_pressed(): + player.stream = load(Global.musictracks[11]) + player.play(0) + + +func _on_credits_3_pressed(): + player.stream = load(Global.musictracks[12]) + player.play(0) diff --git a/levels/musictest.tscn b/levels/musictest.tscn new file mode 100644 index 0000000..184b707 --- /dev/null +++ b/levels/musictest.tscn @@ -0,0 +1,167 @@ +[gd_scene load_steps=8 format=3 uid="uid://c6qj5i5eynv34"] + +[ext_resource type="Script" path="res://levels/musictest.gd" id="1_12esl"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_ba3gi"] +[ext_resource type="Script" path="res://nebula.gd" id="3_f30oj"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_r7nr0"] + +[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="Musictest" 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_12esl") + +[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_ba3gi") +autoplay = true +script = ExtResource("3_f30oj") + +[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 = "Music 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 to stop playback" + +[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="Title Screen" type="Button" parent="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="Galaxy" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3") +text = "Galaxy" + +[node name="Wormhole" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Wormhole" + +[node name="Abstract" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Abstract" + +[node name="Galaxy2" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Galaxy2" + +[node name="Lagoon" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Lagoon" + +[node name="Orion" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Orion" + +[node name="Space" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Space" + +[node name="Stars" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Stars" + +[node name="Universe" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") +text = "Universe" + +[node name="Credits 1" type="Button" parent="VBoxContainer"] +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="VBoxContainer"] +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="VBoxContainer"] +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="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Back" + +[node name="Bottomhud" parent="." instance=ExtResource("4_r7nr0")] +layout_mode = 1 + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="VBoxContainer/Title Screen" to="." method="_on_title_screen_pressed"] +[connection signal="pressed" from="VBoxContainer/Galaxy" to="." method="_on_galaxy_pressed"] +[connection signal="pressed" from="VBoxContainer/Wormhole" to="." method="_on_wormhole_pressed"] +[connection signal="pressed" from="VBoxContainer/Abstract" to="." method="_on_abstract_pressed"] +[connection signal="pressed" from="VBoxContainer/Galaxy2" to="." method="_on_galaxy_2_pressed"] +[connection signal="pressed" from="VBoxContainer/Lagoon" to="." method="_on_lagoon_pressed"] +[connection signal="pressed" from="VBoxContainer/Orion" to="." method="_on_orion_pressed"] +[connection signal="pressed" from="VBoxContainer/Space" to="." method="_on_space_pressed"] +[connection signal="pressed" from="VBoxContainer/Stars" to="." method="_on_stars_pressed"] +[connection signal="pressed" from="VBoxContainer/Universe" to="." method="_on_universe_pressed"] +[connection signal="pressed" from="VBoxContainer/Credits 1" to="." method="_on_credits_1_pressed"] +[connection signal="pressed" from="VBoxContainer/Credits 2" to="." method="_on_credits_2_pressed"] +[connection signal="pressed" from="VBoxContainer/Credits 3" to="." method="_on_credits_3_pressed"] +[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/levels/scene.gd b/levels/scene.gd index a171879..f73cd87 100644 --- a/levels/scene.gd +++ b/levels/scene.gd @@ -1,6 +1,6 @@ extends Control func _ready(): - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) $"VBoxContainer/Galaxy".grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -24,7 +24,7 @@ func _level(): func _input(event): # Mouse in viewport coordinates. - if Input.is_action_pressed("ui_cancel"): + if Input.is_action_just_pressed("ui_cancel"): _on_back_pressed() #print("Mouse Click/Unclick at: ", event.position) # if highlighted == 1: @@ -88,4 +88,7 @@ func _on_universe_pressed(): func _on_credits_pressed(): + Global.gamelevel = 1 + Global.live = 0 + Global.time = 99999 get_tree().change_scene_to_file("res://levels/credits.tscn") diff --git a/levels/scene.tscn b/levels/scene.tscn index 9f28854..9d4d166 100644 --- a/levels/scene.tscn +++ b/levels/scene.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://cntn5tr2w3efj"] +[gd_scene load_steps=8 format=3 uid="uid://cntn5tr2w3efj"] [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"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_kh6lx"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821nm"] bg_color = Color(0, 0.8, 0, 1) @@ -119,6 +120,9 @@ theme_override_font_sizes/font_size = 32 theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") text = "Back" +[node name="Bottomhud" parent="." instance=ExtResource("4_kh6lx")] +layout_mode = 1 + [connection signal="finished" from="nebula" to="nebula" method="_on_finished"] [connection signal="pressed" from="VBoxContainer/Galaxy" to="." method="_on_galaxy_pressed"] [connection signal="pressed" from="VBoxContainer/Wormhole" to="." method="_on_wormhole_pressed"] diff --git a/levels/sfxtest.gd b/levels/sfxtest.gd new file mode 100644 index 0000000..f0b5b08 --- /dev/null +++ b/levels/sfxtest.gd @@ -0,0 +1,52 @@ +extends Control + +var player := AudioStreamPlayer.new() + +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + add_child(player) + $"VBoxContainer/Frank".grab_focus() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _input(event): + # Mouse in viewport coordinates. + if Input.is_action_just_pressed("ui_cancel"): + _on_back_pressed() + if Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_X): + player.stop() + #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/soundtest.tscn") + + +func _on_frank_pressed(): + player.stream = load(Global.sfxtracks[0]) + player.play(0) + + +func _on_crash_pressed(): + player.stream = load(Global.sfxtracks[1]) + player.play(0) + + +func _on_complete_pressed(): + player.stream = load(Global.sfxtracks[2]) + player.play(0) diff --git a/levels/sfxtest.tscn b/levels/sfxtest.tscn new file mode 100644 index 0000000..c09f23b --- /dev/null +++ b/levels/sfxtest.tscn @@ -0,0 +1,91 @@ +[gd_scene load_steps=6 format=3 uid="uid://ma5lm4kay2tk"] + +[ext_resource type="Script" path="res://levels/sfxtest.gd" id="1_npxfc"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_rp1f3"] +[ext_resource type="Script" path="res://nebula.gd" id="3_ou4xk"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_nrda2"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0dqsq"] +bg_color = Color(0, 0.8, 0, 1) + +[node name="Sfxtest" 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_npxfc") + +[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_rp1f3") +autoplay = true +script = ExtResource("3_ou4xk") + +[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 Effect 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 to stop playback" + +[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="Frank" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Frank Voice" + +[node name="Crash" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Crash" + +[node name="Complete" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Complete" + +[node name="Back" type="Button" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 25 +theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +text = "Back" + +[node name="Bottomhud" parent="." instance=ExtResource("4_nrda2")] +layout_mode = 1 + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"] +[connection signal="pressed" from="VBoxContainer/Frank" to="." method="_on_frank_pressed"] +[connection signal="pressed" from="VBoxContainer/Crash" to="." method="_on_crash_pressed"] +[connection signal="pressed" from="VBoxContainer/Complete" to="." method="_on_complete_pressed"] +[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/levels/soundtest.gd b/levels/soundtest.gd index 616ac93..95f7fc9 100644 --- a/levels/soundtest.gd +++ b/levels/soundtest.gd @@ -1,7 +1,7 @@ extends Control func _ready(): - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) - $"VBoxContainer/Title Screen".grab_focus() + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + $"VBoxContainer/Music".grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): @@ -10,7 +10,7 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if Input.is_action_pressed("ui_cancel"): + if Input.is_action_just_pressed("ui_cancel"): _on_back_pressed() #print("Mouse Click/Unclick at: ", event.position) # if highlighted == 1: @@ -31,53 +31,10 @@ 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_music_pressed(): + get_tree().change_scene_to_file("res://levels/musictest.tscn") -func _on_galaxy_pressed(): - pass # Replace with function body. - - -func _on_wormhole_pressed(): - pass # Replace with function body. - - -func _on_abstract_pressed(): - pass # Replace with function body. - - -func _on_galaxy_2_pressed(): - pass # Replace with function body. - - -func _on_lagoon_pressed(): - pass # Replace with function body. - - -func _on_orion_pressed(): - pass # Replace with function body. - - -func _on_space_pressed(): - pass # Replace with function body. - - -func _on_stars_pressed(): - pass # Replace with function body. - - -func _on_universe_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_sfx_pressed(): + get_tree().change_scene_to_file("res://levels/sfxtest.tscn") diff --git a/levels/soundtest.tscn b/levels/soundtest.tscn index 17b4dbc..75b2d2a 100644 --- a/levels/soundtest.tscn +++ b/levels/soundtest.tscn @@ -1,16 +1,17 @@ -[gd_scene load_steps=7 format=3 uid="uid://bpn8rshcjn33c"] +[gd_scene load_steps=8 format=3 uid="uid://bpn8rshcjn33c"] [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"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_e3dgo"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cprm3"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wtbgt"] bg_color = Color(0, 0.8, 0, 1) -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_alctd"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4arqn"] bg_color = Color(0, 0.8, 0, 1) -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0dqsq"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wro6j"] bg_color = Color(0, 0.8, 0, 1) [node name="Soundtest" type="Control"] @@ -40,15 +41,6 @@ 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="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 anchors_preset = 7 @@ -62,102 +54,28 @@ offset_right = 129.5 grow_horizontal = 2 grow_vertical = 0 -[node name="Title Screen" type="Button" parent="VBoxContainer"] +[node name="Music" type="Button" parent="VBoxContainer"] layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3") -text = "Title Screen: X-Force Theme" +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_wtbgt") +text = "Music" -[node name="Galaxy" type="Button" parent="VBoxContainer"] +[node name="Sfx" type="Button" parent="VBoxContainer"] layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3") -text = "Galaxy" - -[node name="Wormhole" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Wormhole" - -[node name="Abstract" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Abstract" - -[node name="Galaxy2" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Galaxy2" - -[node name="Lagoon" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Lagoon" - -[node name="Orion" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Orion" - -[node name="Space" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Space" - -[node name="Stars" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Stars" - -[node name="Universe" type="Button" parent="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Universe" - -[node name="Credits 1" type="Button" parent="VBoxContainer"] -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="VBoxContainer"] -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="VBoxContainer"] -layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_alctd") -text = "Credits 3" +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_4arqn") +text = "Sound Effects" [node name="Back" type="Button" parent="VBoxContainer"] layout_mode = 2 -theme_override_font_sizes/font_size = 25 -theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq") +theme_override_font_sizes/font_size = 80 +theme_override_styles/focus = SubResource("StyleBoxFlat_wro6j") text = "Back" +[node name="Bottomhud" parent="." instance=ExtResource("4_e3dgo")] +layout_mode = 1 + [connection signal="finished" from="nebula" to="nebula" method="_on_finished"] -[connection signal="pressed" from="VBoxContainer/Title Screen" to="." method="_on_title_screen_pressed"] -[connection signal="pressed" from="VBoxContainer/Galaxy" to="." method="_on_galaxy_pressed"] -[connection signal="pressed" from="VBoxContainer/Wormhole" to="." method="_on_wormhole_pressed"] -[connection signal="pressed" from="VBoxContainer/Abstract" to="." method="_on_abstract_pressed"] -[connection signal="pressed" from="VBoxContainer/Galaxy2" to="." method="_on_galaxy_2_pressed"] -[connection signal="pressed" from="VBoxContainer/Lagoon" to="." method="_on_lagoon_pressed"] -[connection signal="pressed" from="VBoxContainer/Orion" to="." method="_on_orion_pressed"] -[connection signal="pressed" from="VBoxContainer/Space" to="." method="_on_space_pressed"] -[connection signal="pressed" from="VBoxContainer/Stars" to="." method="_on_stars_pressed"] -[connection signal="pressed" from="VBoxContainer/Universe" to="." method="_on_universe_pressed"] -[connection signal="pressed" from="VBoxContainer/Credits 1" to="." method="_on_credits_1_pressed"] -[connection signal="pressed" from="VBoxContainer/Credits 2" to="." method="_on_credits_2_pressed"] -[connection signal="pressed" from="VBoxContainer/Credits 3" to="." method="_on_credits_3_pressed"] +[connection signal="pressed" from="VBoxContainer/Music" to="." method="_on_music_pressed"] +[connection signal="pressed" from="VBoxContainer/Sfx" to="." method="_on_sfx_pressed"] [connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"] diff --git a/levels/tmenu.gd b/levels/tmenu.gd index 25505b4..fc02a5a 100644 --- a/levels/tmenu.gd +++ b/levels/tmenu.gd @@ -1,6 +1,6 @@ extends Control func _ready(): - Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) $VBoxContainer/Start.grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. diff --git a/levels/tmenu.tscn b/levels/tmenu.tscn index 9f1e130..98ac655 100644 --- a/levels/tmenu.tscn +++ b/levels/tmenu.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://b0anr0rhqs0tu"] +[gd_scene load_steps=8 format=3 uid="uid://b0anr0rhqs0tu"] [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"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="4_4c223"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_821nm"] bg_color = Color(0, 0.8, 0, 1) @@ -71,6 +72,9 @@ theme_override_font_sizes/font_size = 80 theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn") text = "Exit" +[node name="Bottomhud" parent="." instance=ExtResource("4_4c223")] +layout_mode = 1 + [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"] diff --git a/levels/wormhole.gd b/levels/wormhole.gd index d0d4838..2b636dc 100644 --- a/levels/wormhole.gd +++ b/levels/wormhole.gd @@ -6,7 +6,7 @@ var bgsound := AudioStreamPlayer.new() func _ready(): add_child(bgsound) - var titlemusic = load("res://music/eternity.wav") + var titlemusic = load(Global.musictracks[2]) bgsound.stream = titlemusic bgsound.play(0) #pass # Replace with function body. diff --git a/bootclick.gd b/main.gd similarity index 81% rename from bootclick.gd rename to main.gd index b2e8878..29b3439 100644 --- a/bootclick.gd +++ b/main.gd @@ -1,7 +1,5 @@ extends Node -var title = preload("res://title.tscn").instantiate() -var boot = preload("res://bootclick.tscn").instantiate() const loadgame = preload("res://load.gd") const savegame = preload("res://save.gd") @@ -25,7 +23,7 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if !Global.sk && (event is InputEventMouseButton || Input.is_action_pressed("ui_accept")): + if !Global.sk && Input.is_action_just_pressed("ui_accept"): #print("Mouse Click/Unclick at: ", event.position) _title() diff --git a/bootclick.tscn b/main.tscn similarity index 52% rename from bootclick.tscn rename to main.tscn index 14876d2..f9f8077 100644 --- a/bootclick.tscn +++ b/main.tscn @@ -1,15 +1,17 @@ -[gd_scene load_steps=4 format=3 uid="uid://dcc82vy3jkg0o"] +[gd_scene load_steps=4 format=3 uid="uid://brfix6t76y1ut"] -[ext_resource type="Script" path="res://bootclick.gd" id="1_52bti"] -[ext_resource type="PackedScene" uid="uid://dblfov80ngodu" path="res://selftest.tscn" id="3_jtnh5"] -[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="3_wfymi"] +[ext_resource type="Script" path="res://main.gd" id="1_51vn3"] +[ext_resource type="PackedScene" uid="uid://dblfov80ngodu" path="res://selftest.tscn" id="2_jnmxu"] +[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="3_tig2r"] -[node name="bootclick" type="Control"] +[node name="Main" type="Control"] layout_mode = 3 -anchors_preset = 0 -offset_right = 40.0 -offset_bottom = 40.0 -script = ExtResource("1_52bti") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_51vn3") [node name="Label" type="Label" parent="."] layout_mode = 0 @@ -22,12 +24,12 @@ text = "Press enter or B to continue" horizontal_alignment = 1 vertical_alignment = 1 -[node name="Selftest" parent="." instance=ExtResource("3_jtnh5")] +[node name="Selftest" parent="." instance=ExtResource("2_jnmxu")] layout_mode = 0 offset_left = 57.0 offset_top = 112.0 offset_right = 97.0 offset_bottom = 135.0 -[node name="Bottomhud" parent="." instance=ExtResource("3_wfymi")] +[node name="Bottomhud" parent="." instance=ExtResource("3_tig2r")] layout_mode = 1 diff --git a/project.godot b/project.godot index f99ab65..d722fe6 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="The Red Robot Radio" -run/main_scene="res://bootclick.tscn" +run/main_scene="res://main.tscn" config/features=PackedStringArray("4.2", "GL Compatibility") boot_splash/show_image=false config/icon="res://icon.png" diff --git a/title.gd b/title.gd index f9064b8..0db40d3 100644 --- a/title.gd +++ b/title.gd @@ -15,8 +15,8 @@ func _ready(): Global.gamelevel = null add_child(bgsound) add_child(frank) - var titlemusic = load("res://music/x-force.wav") - var r3jingle = load("res://sfx/title.wav") + var titlemusic = load(Global.musictracks[0]) + var r3jingle = load(Global.sfxtracks[0]) bgsound.stream = titlemusic bgsound.play(0) frank.stream = r3jingle @@ -31,11 +31,11 @@ func _process(delta): func _input(event): # Mouse in viewport coordinates. - if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_action_pressed("ui_accept")): + if Input.is_action_just_pressed("ui_accept"): #print("Mouse Click/Unclick at: ", event.position) get_tree().change_scene_to_file("res://levels/tmenu.tscn") #_level() - elif (Time.get_ticks_msec() - wait) >= 1000 && (Input.is_action_pressed("ui_cancel")): + elif Input.is_action_just_pressed("ui_cancel"): get_tree().quit() func _level():