diff --git a/Arrow (1).png b/Arrow (1).png deleted file mode 100644 index 9699b64..0000000 Binary files a/Arrow (1).png and /dev/null differ diff --git a/Circle.png.import b/Circle.png.import index 277b0d5..c8cb0ca 100644 --- a/Circle.png.import +++ b/Circle.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cso5ufbf7u7oj" +uid="uid://bvpoajwx0yw3y" path="res://.godot/imported/Circle.png-5aa705d158b14b9f860407e6f23b289d.ctex" metadata={ "vram_texture": false diff --git a/Flow State 2.ogg b/Flow State 2.ogg new file mode 100644 index 0000000..79f40ff Binary files /dev/null and b/Flow State 2.ogg differ diff --git a/Flow State 2.ogg.import b/Flow State 2.ogg.import new file mode 100644 index 0000000..267ab5d --- /dev/null +++ b/Flow State 2.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://b8soxqg0jquqg" +path="res://.godot/imported/Flow State 2.ogg-f34c569013c5b89f260290636f7a1c71.oggvorbisstr" + +[deps] + +source_file="res://Flow State 2.ogg" +dest_files=["res://.godot/imported/Flow State 2.ogg-f34c569013c5b89f260290636f7a1c71.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Flow State.wav b/Flow State.wav deleted file mode 100644 index 9db42a7..0000000 Binary files a/Flow State.wav and /dev/null differ diff --git a/Flow State.wav.import b/Flow State.wav.import deleted file mode 100644 index 2d6dc9b..0000000 --- a/Flow State.wav.import +++ /dev/null @@ -1,24 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamWAV" -uid="uid://d3icnl4vjbbt7" -path="res://.godot/imported/Flow State.wav-724bf1be86d97bd6a743676d78bb1bd5.sample" - -[deps] - -source_file="res://Flow State.wav" -dest_files=["res://.godot/imported/Flow State.wav-724bf1be86d97bd6a743676d78bb1bd5.sample"] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=false -edit/normalize=false -edit/loop_mode=0 -edit/loop_begin=0 -edit/loop_end=-1 -compress/mode=0 diff --git a/Hexagon outline.png b/Hexagon outline.png deleted file mode 100644 index a1f50b0..0000000 Binary files a/Hexagon outline.png and /dev/null differ diff --git a/Hexagon.png b/Hexagon.png deleted file mode 100644 index 620f0d8..0000000 Binary files a/Hexagon.png and /dev/null differ diff --git a/Pentagon.png b/Pentagon.png deleted file mode 100644 index 3506494..0000000 Binary files a/Pentagon.png and /dev/null differ diff --git a/Settings.gd b/Settings.gd index d37cb19..07d4de9 100644 --- a/Settings.gd +++ b/Settings.gd @@ -10,6 +10,7 @@ func _ready(): $"../Layout/Play".disabled = not has_config if has_config: $Menu/Username.text = config.get_value("config", "username") + $Menu/MusicVolume.value = config.get_value("config", "music_volume", 1) $Menu/Controls.selected = 0 if config.get_value("config", "relative_controls") else 1 $Menu/Character.selected = CHARACTERS.find(config.get_value("gameplay", "class", "res://player-row.tscn")) @@ -22,6 +23,7 @@ func check_valid(none): func save(): config.set_value("config", "username", $Menu/Username.text) config.set_value("config", "relative_controls", $Menu/Controls.selected == 0) + config.set_value("config", "music_volume", $Menu/MusicVolume.value) config.set_value("gameplay", "class", CHARACTERS[$Menu/Character.selected]) diff --git a/VolumeSlider.gd b/VolumeSlider.gd new file mode 100644 index 0000000..dec3d83 --- /dev/null +++ b/VolumeSlider.gd @@ -0,0 +1,9 @@ +extends HSlider + + +@export var audio_bus_name := "Music" + +@onready var _bus := AudioServer.get_bus_index(audio_bus_name) + +func _on_value_changed(value: float) -> void: + AudioServer.set_bus_volume_db(_bus, linear_to_db(value)) diff --git a/blue_button04.png b/blue_button04.png new file mode 100644 index 0000000..0228cd1 Binary files /dev/null and b/blue_button04.png differ diff --git a/Hexagon.png.import b/blue_button04.png.import similarity index 68% rename from Hexagon.png.import rename to blue_button04.png.import index acdd479..2f9bd51 100644 --- a/Hexagon.png.import +++ b/blue_button04.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://baaak3ooc6rvq" -path="res://.godot/imported/Hexagon.png-1b862bf89e6b7922fd88f522a8d27f58.ctex" +uid="uid://dl3pgdjygxox3" +path="res://.godot/imported/blue_button04.png-b41db7426af2e33b5d2bde0c46856a2f.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Hexagon.png" -dest_files=["res://.godot/imported/Hexagon.png-1b862bf89e6b7922fd88f522a8d27f58.ctex"] +source_file="res://blue_button04.png" +dest_files=["res://.godot/imported/blue_button04.png-b41db7426af2e33b5d2bde0c46856a2f.ctex"] [params] diff --git a/blue_button13.png b/blue_button13.png new file mode 100644 index 0000000..ecab5b0 Binary files /dev/null and b/blue_button13.png differ diff --git a/Pentagon.png.import b/blue_button13.png.import similarity index 68% rename from Pentagon.png.import rename to blue_button13.png.import index 278890e..cd57d98 100644 --- a/Pentagon.png.import +++ b/blue_button13.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://3y48ijiv4vlf" -path="res://.godot/imported/Pentagon.png-7ed5bfa4e2087f30c59e5bfaa438c497.ctex" +uid="uid://clup3yrjkl3ya" +path="res://.godot/imported/blue_button13.png-efecb640d918141142b733c907819e72.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Pentagon.png" -dest_files=["res://.godot/imported/Pentagon.png-7ed5bfa4e2087f30c59e5bfaa438c497.ctex"] +source_file="res://blue_button13.png" +dest_files=["res://.godot/imported/blue_button13.png-efecb640d918141142b733c907819e72.ctex"] [params] diff --git a/blue_sliderDown.png b/blue_sliderDown.png new file mode 100644 index 0000000..44f95d1 Binary files /dev/null and b/blue_sliderDown.png differ diff --git a/Hexagon outline.png.import b/blue_sliderDown.png.import similarity index 68% rename from Hexagon outline.png.import rename to blue_sliderDown.png.import index b289e7c..c1e1df2 100644 --- a/Hexagon outline.png.import +++ b/blue_sliderDown.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://xq1dd6w22i6f" -path="res://.godot/imported/Hexagon outline.png-ad717813cdc35ccaddcd417e4a24f3ba.ctex" +uid="uid://1mfe7gltx0lk" +path="res://.godot/imported/blue_sliderDown.png-542a49bb68b27a35b8d39003ebe93225.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Hexagon outline.png" -dest_files=["res://.godot/imported/Hexagon outline.png-ad717813cdc35ccaddcd417e4a24f3ba.ctex"] +source_file="res://blue_sliderDown.png" +dest_files=["res://.godot/imported/blue_sliderDown.png-542a49bb68b27a35b8d39003ebe93225.ctex"] [params] diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..84c0873 --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,15 @@ +[gd_resource type="AudioBusLayout" format=3 uid="uid://dmlt4ui0h4bn3"] + +[resource] +bus/1/name = &"Music" +bus/1/solo = false +bus/1/mute = false +bus/1/bypass_fx = false +bus/1/volume_db = 0.0 +bus/1/send = &"Master" +bus/2/name = &"SFX" +bus/2/solo = false +bus/2/mute = false +bus/2/bypass_fx = false +bus/2/volume_db = 0.0 +bus/2/send = &"Master" diff --git a/main.gd b/main.gd index dd5dc35..317ba4a 100644 --- a/main.gd +++ b/main.gd @@ -7,6 +7,8 @@ func _ready(): var player = load(config.get_value("gameplay", "class", "res://player-row.tscn")).instantiate() player.position = Vector2(1920/2, 1080/2) add_child(player) + + $Music.volume_db = linear_to_db(config.get_value("config", "music_volume", 1)) # Called every frame. 'delta' is the elapsed time since the previous frame. diff --git a/main.tscn b/main.tscn index 881b11f..60243b1 100644 --- a/main.tscn +++ b/main.tscn @@ -15,12 +15,12 @@ [ext_resource type="AudioStream" uid="uid://dn65uapn0wsok" path="res://impactMetal_002.ogg" id="11_acuni"] [ext_resource type="Script" path="res://CollisionCheck.gd" id="11_ryeyk"] [ext_resource type="FontFile" uid="uid://bnguin7bsyx6e" path="res://Kenney Future.ttf" id="11_s4q6p"] -[ext_resource type="Texture2D" uid="uid://cso5ufbf7u7oj" path="res://Circle.png" id="13_318fy"] +[ext_resource type="Texture2D" uid="uid://bvpoajwx0yw3y" path="res://Circle.png" id="13_318fy"] [ext_resource type="Script" path="res://Notification.gd" id="13_lkv81"] [ext_resource type="Script" path="res://Stopwatch.gd" id="13_xhnp2"] [ext_resource type="Script" path="res://Leaderboard.gd" id="14_v1elq"] [ext_resource type="PackedScene" uid="uid://4sdwatj6up8i" path="res://tar.tscn" id="19_8258f"] -[ext_resource type="AudioStream" uid="uid://d3icnl4vjbbt7" path="res://Flow State.wav" id="21_7tjgd"] +[ext_resource type="AudioStream" uid="uid://b8soxqg0jquqg" path="res://Flow State 2.ogg" id="21_7hdkm"] [sub_resource type="Resource" id="Resource_ur7l5"] script = ExtResource("4_um0x7") @@ -887,8 +887,8 @@ script = ExtResource("13_lkv81") process_mode = 3 script = ExtResource("1_k8sg3") -[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource("21_7tjgd") +[node name="Music" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("21_7hdkm") autoplay = true [connection signal="wave_complete" from="Spawner" to="UI/Stopwatch" method="wave_finished"] diff --git a/main_menu.tscn b/main_menu.tscn index 10a871d..a9e7c87 100644 --- a/main_menu.tscn +++ b/main_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://ck1db6d8whbac"] +[gd_scene load_steps=11 format=3 uid="uid://ck1db6d8whbac"] [ext_resource type="Script" path="res://MainMenu.gd" id="1_omrmt"] [ext_resource type="Texture2D" uid="uid://bfuxwsctqat2v" path="res://main_menu.png" id="2_vrg41"] @@ -6,6 +6,12 @@ [ext_resource type="Script" path="res://Settings.gd" id="5_sarwv"] [ext_resource type="Texture2D" uid="uid://bdg4mycyxr8hw" path="res://loading_bg.png" id="6_fwqfu"] [ext_resource type="Script" path="res://EmojiValidator.gd" id="6_ojb71"] +[ext_resource type="Texture2D" uid="uid://1mfe7gltx0lk" path="res://blue_sliderDown.png" id="6_tt6es"] +[ext_resource type="Script" path="res://VolumeSlider.gd" id="7_qc1t8"] +[ext_resource type="AudioStream" uid="uid://b8soxqg0jquqg" path="res://Flow State 2.ogg" id="8_uvg4p"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4ojsq"] +bg_color = Color(0.6, 0.6, 0.6, 0) [node name="MainMenu" type="Control"] layout_mode = 3 @@ -124,6 +130,7 @@ grow_vertical = 2 columns = 2 [node name="Label" type="Label" parent="Settings Panel/Menu"] +custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_horizontal = 0 theme_override_fonts/font = ExtResource("4_ybv7t") @@ -143,6 +150,7 @@ script = ExtResource("6_ojb71") pattern = "^[A-Za-z]+" [node name="Label2" type="Label" parent="Settings Panel/Menu"] +custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_horizontal = 0 theme_override_fonts/font = ExtResource("4_ybv7t") @@ -161,6 +169,7 @@ popup/item_1/text = "Absolute" popup/item_1/id = 1 [node name="Label3" type="Label" parent="Settings Panel/Menu"] +custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_horizontal = 0 theme_override_fonts/font = ExtResource("4_ybv7t") @@ -178,6 +187,25 @@ popup/item_0/id = 0 popup/item_1/text = "Apezoid" popup/item_1/id = 1 +[node name="Label4" type="Label" parent="Settings Panel/Menu"] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_fonts/font = ExtResource("4_ybv7t") +theme_override_font_sizes/font_size = 80 +text = "music" + +[node name="MusicVolume" type="HSlider" parent="Settings Panel/Menu"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 +size_flags_vertical = 4 +theme_override_icons/grabber = ExtResource("6_tt6es") +theme_override_icons/grabber_highlight = ExtResource("6_tt6es") +theme_override_styles/grabber_area = SubResource("StyleBoxFlat_4ojsq") +theme_override_styles/grabber_area_highlight = SubResource("StyleBoxFlat_4ojsq") +max_value = 1.0 +step = 0.01 +script = ExtResource("7_qc1t8") + [node name="Tutorial Text" type="Label" parent="."] visible = false z_index = 2 @@ -269,6 +297,11 @@ theme_override_font_sizes/normal_font_size = 200 bbcode_enabled = true text = "[center][wave]LOADING..." +[node name="Music" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("8_uvg4p") +autoplay = true +bus = &"Music" + [connection signal="pressed" from="Layout/Play" to="." method="play"] [connection signal="pressed" from="Layout/Settings" to="Settings Panel" method="show"] [connection signal="pressed" from="Layout/Tutorial" to="Tutorial Text" method="show"] @@ -276,4 +309,5 @@ text = "[center][wave]LOADING..." [connection signal="pressed" from="Settings Panel/Close" to="Settings Panel" method="hide"] [connection signal="text_changed" from="Settings Panel/Menu/Username" to="Settings Panel" method="check_valid"] [connection signal="text_changed" from="Settings Panel/Menu/Username" to="Settings Panel/Menu/Username" method="check"] +[connection signal="value_changed" from="Settings Panel/Menu/MusicVolume" to="Settings Panel/Menu/MusicVolume" method="_on_value_changed"] [connection signal="pressed" from="Tutorial Text/Close" to="Tutorial Text" method="hide"] diff --git a/red_button04.png b/red_button04.png new file mode 100644 index 0000000..41d9deb Binary files /dev/null and b/red_button04.png differ diff --git a/Arrow (1).png.import b/red_button04.png.import similarity index 68% rename from Arrow (1).png.import rename to red_button04.png.import index b8724ec..5a52031 100644 --- a/Arrow (1).png.import +++ b/red_button04.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cyk2dqt7ipjg1" -path="res://.godot/imported/Arrow (1).png-f7829071ab4d36b28f9cf326802d31fe.ctex" +uid="uid://dn1yo2quvk68u" +path="res://.godot/imported/red_button04.png-16e19973b0063994181b1e1b01d2a073.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Arrow (1).png" -dest_files=["res://.godot/imported/Arrow (1).png-f7829071ab4d36b28f9cf326802d31fe.ctex"] +source_file="res://red_button04.png" +dest_files=["res://.godot/imported/red_button04.png-16e19973b0063994181b1e1b01d2a073.ctex"] [params]