diff --git a/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.md5 b/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.md5 index f8ec446..3e87a8d 100644 --- a/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.md5 +++ b/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.md5 @@ -1,3 +1,3 @@ -source_md5="34ec780a689ee26dcc3dbb0284b5d62e" -dest_md5="296cd9dd4663fd6ef7497891143e8b8a" +source_md5="d2c223adbb6b13c83613990e6f18bd10" +dest_md5="ca793b2f3d46e3424730440450e8dc84" diff --git a/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.stex b/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.stex index 90da3dd..2e0ced9 100644 Binary files a/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.stex and b/.import/fullscreen.png-55cf7f791aa76b3efef5dd425b98ad37.stex differ diff --git a/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.md5 b/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.md5 index f8ec446..ae77dfe 100644 --- a/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.md5 +++ b/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.md5 @@ -1,3 +1,3 @@ -source_md5="34ec780a689ee26dcc3dbb0284b5d62e" -dest_md5="296cd9dd4663fd6ef7497891143e8b8a" +source_md5="8ec458c19f00fc8b04b015e1adccd50d" +dest_md5="27eaa723c22833d1e7fbbc721dbf2b0a" diff --git a/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.stex b/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.stex index 90da3dd..a2cf045 100644 Binary files a/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.stex and b/.import/fullscreen_hover.png-234d15a60e0d8e1f8f034279e5b566eb.stex differ diff --git a/.import/music.png-d125e661be6c28155c2d451004121da2.md5 b/.import/music.png-d125e661be6c28155c2d451004121da2.md5 new file mode 100644 index 0000000..c90a69a --- /dev/null +++ b/.import/music.png-d125e661be6c28155c2d451004121da2.md5 @@ -0,0 +1,3 @@ +source_md5="c632c103f99ec61a551cb31ec0143c4f" +dest_md5="91acb9457da06ce66a7ab0f91bb93138" + diff --git a/.import/music.png-d125e661be6c28155c2d451004121da2.stex b/.import/music.png-d125e661be6c28155c2d451004121da2.stex new file mode 100644 index 0000000..510956b Binary files /dev/null and b/.import/music.png-d125e661be6c28155c2d451004121da2.stex differ diff --git a/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.md5 b/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.md5 new file mode 100644 index 0000000..c90d3e8 --- /dev/null +++ b/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.md5 @@ -0,0 +1,3 @@ +source_md5="4b9be3cb1201ae5050099ba978cccc0f" +dest_md5="0b4c8626ccef55f639eb538c545d1f74" + diff --git a/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.stex b/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.stex new file mode 100644 index 0000000..83beadd Binary files /dev/null and b/.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.stex differ diff --git a/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.md5 b/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.md5 new file mode 100644 index 0000000..56345a1 --- /dev/null +++ b/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.md5 @@ -0,0 +1,3 @@ +source_md5="24cecb639e4518c4925b3159299a7470" +dest_md5="b207456189caca2e8832f0fefa6e0b8b" + diff --git a/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.oggstr b/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.oggstr new file mode 100644 index 0000000..0805f92 Binary files /dev/null and b/.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.oggstr differ diff --git a/Aseprite/fullscreen.png b/Aseprite/fullscreen.png index aa8c5f2..ca5b189 100644 Binary files a/Aseprite/fullscreen.png and b/Aseprite/fullscreen.png differ diff --git a/Aseprite/fullscreen_hover.png b/Aseprite/fullscreen_hover.png index aa8c5f2..e1ba2b0 100644 Binary files a/Aseprite/fullscreen_hover.png and b/Aseprite/fullscreen_hover.png differ diff --git a/Aseprite/music.png b/Aseprite/music.png new file mode 100644 index 0000000..d87b38f Binary files /dev/null and b/Aseprite/music.png differ diff --git a/Aseprite/music.png.import b/Aseprite/music.png.import new file mode 100644 index 0000000..ae4a080 --- /dev/null +++ b/Aseprite/music.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/music.png-d125e661be6c28155c2d451004121da2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Aseprite/music.png" +dest_files=[ "res://.import/music.png-d125e661be6c28155c2d451004121da2.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Aseprite/music_hover.png b/Aseprite/music_hover.png new file mode 100644 index 0000000..0b422a6 Binary files /dev/null and b/Aseprite/music_hover.png differ diff --git a/Aseprite/music_hover.png.import b/Aseprite/music_hover.png.import new file mode 100644 index 0000000..b4cc660 --- /dev/null +++ b/Aseprite/music_hover.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Aseprite/music_hover.png" +dest_files=[ "res://.import/music_hover.png-c315a7c29fc993518e6ed26b897dad29.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Menu/Theme.tres b/Menu/Theme.tres new file mode 100644 index 0000000..8a44629 --- /dev/null +++ b/Menu/Theme.tres @@ -0,0 +1,3 @@ +[gd_resource type="Theme" format=2] + +[resource] diff --git a/Menu/Volume.gd b/Menu/Volume.gd new file mode 100644 index 0000000..4e2a880 --- /dev/null +++ b/Menu/Volume.gd @@ -0,0 +1,9 @@ +extends VSlider + +export var bus_channel = "Master" + +func _ready(): + value = db2linear(AudioServer.get_bus_volume_db(AudioServer.get_bus_index(bus_channel))) + +func _on_MusicVolume_value_changed(value: float) -> void: + AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus_channel), linear2db(value)) diff --git a/Music/Music.tscn b/Music/Music.tscn new file mode 100644 index 0000000..e30268a --- /dev/null +++ b/Music/Music.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Music/untitled_plant_game.ogg" type="AudioStream" id=1] + +[node name="Music" type="AudioStreamPlayer"] +stream = ExtResource( 1 ) +autoplay = true +bus = "Music" diff --git a/Music/untitled_plant_game.ogg b/Music/untitled_plant_game.ogg new file mode 100644 index 0000000..ca2d9e8 Binary files /dev/null and b/Music/untitled_plant_game.ogg differ diff --git a/Music/untitled_plant_game.ogg.import b/Music/untitled_plant_game.ogg.import new file mode 100644 index 0000000..b925b51 --- /dev/null +++ b/Music/untitled_plant_game.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.oggstr" + +[deps] + +source_file="res://Music/untitled_plant_game.ogg" +dest_files=[ "res://.import/untitled_plant_game.ogg-31760f108d0f02d04c8560ca1ea3daf1.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/World/Main.tscn b/World/Main.tscn index 25966ba..a3e7212 100644 --- a/World/Main.tscn +++ b/World/Main.tscn @@ -1,19 +1,42 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://World/Plant.tscn" type="PackedScene" id=1] [ext_resource path="res://World/FullscreenButton.gd" type="Script" id=2] [ext_resource path="res://Aseprite/fullscreen.png" type="Texture" id=3] [ext_resource path="res://Aseprite/fullscreen_hover.png" type="Texture" id=4] +[ext_resource path="res://Menu/Theme.tres" type="Theme" id=5] +[ext_resource path="res://Menu/Volume.gd" type="Script" id=6] +[ext_resource path="res://Aseprite/music.png" type="Texture" id=7] +[ext_resource path="res://Aseprite/music_hover.png" type="Texture" id=8] + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.14902, 0.0431373, 0.129412, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.94902, 0.988235, 0.878431, 1 ) +expand_margin_left = 2.0 +expand_margin_right = 2.0 [node name="Main" type="Node2D"] [node name="Plant" parent="." instance=ExtResource( 1 )] -[node name="FullscreenButton" type="TextureButton" parent="."] -margin_left = 238.0 -margin_top = 126.0 +[node name="Panel" type="Panel" parent="."] +margin_left = 236.0 +margin_top = 2.0 margin_right = 254.0 margin_bottom = 142.0 +theme = ExtResource( 5 ) +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="FullscreenButton" type="TextureButton" parent="Panel"] +margin_left = 1.0 +margin_top = 123.0 +margin_right = 17.0 +margin_bottom = 139.0 texture_normal = ExtResource( 3 ) texture_hover = ExtResource( 4 ) script = ExtResource( 2 ) @@ -21,4 +44,34 @@ __meta__ = { "_edit_use_anchors_": false } -[connection signal="pressed" from="FullscreenButton" to="FullscreenButton" method="_on_FullscreenButton_pressed"] +[node name="MusicVolume" type="VSlider" parent="Panel"] +margin_left = 1.0 +margin_top = 1.0 +margin_right = 17.0 +margin_bottom = 120.0 +custom_icons/tick = ExtResource( 7 ) +custom_icons/grabber_disabled = ExtResource( 7 ) +custom_icons/grabber_highlight = ExtResource( 8 ) +custom_icons/grabber = ExtResource( 7 ) +custom_styles/slider = SubResource( 2 ) +max_value = 1.0 +step = 0.1 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} +bus_channel = "Music" + +[node name="Panel2" type="Panel" parent="."] +margin_left = 130.0 +margin_top = 2.0 +margin_right = 234.0 +margin_bottom = 142.0 +theme = ExtResource( 5 ) +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="pressed" from="Panel/FullscreenButton" to="Panel/FullscreenButton" method="_on_FullscreenButton_pressed"] +[connection signal="value_changed" from="Panel/MusicVolume" to="Panel/MusicVolume" method="_on_MusicVolume_value_changed"] diff --git a/World/Plant.gd b/World/Plant.gd index 4b679dc..7e952c5 100644 --- a/World/Plant.gd +++ b/World/Plant.gd @@ -5,7 +5,7 @@ var pixels_x = [] var active = [] var rng -func _process(delta: float) -> void: +func _process(_delta): # step() pass diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..c7cc7bc --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,10 @@ +[gd_resource type="AudioBusLayout" format=2] + +[resource] +bus/0/volume_db = -0.725993 +bus/1/name = "Music" +bus/1/solo = false +bus/1/mute = false +bus/1/bypass_fx = false +bus/1/volume_db = -0.130497 +bus/1/send = "Master" diff --git a/project.godot b/project.godot index f144aa9..325db8a 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,10 @@ config/name="Untitled Plant Game" run/main_scene="res://World/Main.tscn" config/icon="res://icon.png" +[autoload] + +Music="*res://Music/Music.tscn" + [display] window/size/width=256