diff --git a/scenes/audio_sequencer.tscn b/scenes/audio_sequencer.tscn index d74e028..671f21b 100644 --- a/scenes/audio_sequencer.tscn +++ b/scenes/audio_sequencer.tscn @@ -5,7 +5,7 @@ [sub_resource type="Resource" id="Resource_iuccj"] script = ExtResource("2_npxdp") -restartTreshold = 0.3 +restartTreshold = 0.0 metadata/_custom_type_script = "uid://c1x4n4nqyq72f" [node name="AudioSequencer" type="Node"] diff --git a/scenes/entities/Zombies/bucket_zombie.tscn b/scenes/entities/Zombies/bucket_zombie.tscn index 66a8c37..9e9e1b9 100644 --- a/scenes/entities/Zombies/bucket_zombie.tscn +++ b/scenes/entities/Zombies/bucket_zombie.tscn @@ -38,31 +38,31 @@ material = SubResource("ShaderMaterial_wdi07") scale = Vector2(0.999912, 0.999912) [node name="RightUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="1"] -scale = Vector2(0.999828, 0.999828) - -[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"] -scale = Vector2(0.999833, 0.999833) - -[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"] -scale = Vector2(0.999831, 0.999831) - -[node name="LeftUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="2"] -scale = Vector2(0.999834, 0.999834) - -[node name="LeftLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg" index="1"] scale = Vector2(0.999832, 0.999832) +[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"] +scale = Vector2(0.999836, 0.999836) + +[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"] +scale = Vector2(0.999832, 0.999832) + +[node name="LeftUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="2"] +scale = Vector2(0.999836, 0.999836) + +[node name="LeftLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg" index="1"] +scale = Vector2(0.999834, 0.999834) + [node name="LeftFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg" index="1"] -scale = Vector2(0.999823, 0.999823) +scale = Vector2(0.999833, 0.999833) [node name="Body" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="3"] scale = Vector2(0.999829, 0.999829) [node name="RightUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="0"] -scale = Vector2(0.999824, 0.999824) +scale = Vector2(0.999828, 0.999828) [node name="RightLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm" index="1"] -scale = Vector2(0.999821, 0.999821) +scale = Vector2(0.999825, 0.999825) [node name="RightHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm" index="0"] scale = Vector2(0.999828, 0.999828) @@ -81,13 +81,13 @@ degradationStages = Array[Texture]([ExtResource("3_0nlp0"), ExtResource("4_xx7fu scale = Vector2(0.999828, 0.999828) [node name="LeftUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="4"] -scale = Vector2(0.999826, 0.999826) +scale = Vector2(0.999828, 0.999828) [node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="1"] scale = Vector2(0.999829, 0.999829) [node name="LeftHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="0"] -scale = Vector2(0.999828, 0.999828) +scale = Vector2(0.99983, 0.99983) [node name="Eatbox" parent="." index="2"] _damage = SubResource("Resource_2bm8y") diff --git a/scenes/entities/Zombies/cone_zombie.tscn b/scenes/entities/Zombies/cone_zombie.tscn index 118f53e..65a4e3d 100644 --- a/scenes/entities/Zombies/cone_zombie.tscn +++ b/scenes/entities/Zombies/cone_zombie.tscn @@ -113,7 +113,7 @@ scale = Vector2(0.99983, 0.99983) scale = Vector2(0.999828, 0.999828) [node name="LeftHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="0"] -scale = Vector2(0.999829, 0.999829) +scale = Vector2(0.999828, 0.999828) [node name="Eatbox" parent="." index="2"] _damage = SubResource("Resource_w70im") diff --git a/scenes/entities/Zombies/zombie.tscn b/scenes/entities/Zombies/zombie.tscn index 84b9fac..94940a1 100644 --- a/scenes/entities/Zombies/zombie.tscn +++ b/scenes/entities/Zombies/zombie.tscn @@ -2794,7 +2794,7 @@ editor_settings/show_bone_gizmo = false [node name="RightFoot" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg"] position = Vector2(-2, 14) -scale = Vector2(0.999833, 0.999833) +scale = Vector2(0.999832, 0.999832) rest = Transform2D(1, 0, 0, 1, -2, 14) auto_calculate_length_and_angle = false length = 12.0 diff --git a/scenes/gui/choose_your_seeds.tscn b/scenes/gui/choose_your_seeds.tscn index 7279861..3f14c76 100644 --- a/scenes/gui/choose_your_seeds.tscn +++ b/scenes/gui/choose_your_seeds.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://dpxxjfd5lv5sv"] +[gd_scene load_steps=21 format=3 uid="uid://dpxxjfd5lv5sv"] [ext_resource type="Theme" uid="uid://e8n88g31w7x7" path="res://resources/themes/ChooseYourSeeds.tres" id="1_bfo8i"] [ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="2_so2bw"] @@ -10,6 +10,7 @@ [ext_resource type="Texture2D" uid="uid://drydueofrb448" path="res://assets/sprites/gui/almanach/book.tres" id="8_hmdmm"] [ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="8_v7xff"] [ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="9_v7xff"] +[ext_resource type="Script" uid="uid://c1x4n4nqyq72f" path="res://scripts/audio/ChannelSettings.cs" id="10_nlh6x"] [ext_resource type="PackedScene" uid="uid://bvpt0q4j6nx18" path="res://scenes/gui/almanach.tscn" id="11_nlh6x"] [sub_resource type="Animation" id="Animation_0rps3"] @@ -118,6 +119,11 @@ func _pressed() -> void: $\"../../ChannelPlayer\".call(\"Play\") " +[sub_resource type="Resource" id="Resource_l66rp"] +script = ExtResource("10_nlh6x") +restartTreshold = -1.0 +metadata/_custom_type_script = "uid://c1x4n4nqyq72f" + [node name="ChooseYourSeeds" type="Control"] process_mode = 3 layout_mode = 3 @@ -248,6 +254,7 @@ metadata/_edit_use_anchors_ = true [node name="ChannelPlayer" type="Node" parent="."] script = ExtResource("8_v7xff") +settings = SubResource("Resource_l66rp") audioStream = ExtResource("9_v7xff") channel = "button" metadata/_custom_type_script = "uid://c36bj8u7jghc7" diff --git a/scripts/audio/AudioSequencer.cs b/scripts/audio/AudioSequencer.cs index 94056aa..e3e4867 100644 --- a/scripts/audio/AudioSequencer.cs +++ b/scripts/audio/AudioSequencer.cs @@ -32,9 +32,10 @@ public partial class AudioSequencer : Node return instance.channelProcess[id] && instance.channels[id].GetPlaybackPosition() < instance.channelSettings[id].restartTreshold / Engine.TimeScale; } - public static void Play(string id, AudioStream what) + public static void Play(string id, AudioStream what, ChannelSettings settings = null) { if (IsChannelPlaying(id)) return; + if (settings != null) ChangeSettings(id, settings); instance.PlayAtChannel(id, what); } @@ -56,6 +57,7 @@ public partial class AudioSequencer : Node channels.Add(id, player); channelProcess.Add(id, false); player.Name = id; + player.MaxPolyphony = 5; player.Finished += () => { MarkChannel(id, false); };