Player Sound refactored

soundplayback moved to states
This commit is contained in:
Streamfire
2020-04-19 12:40:19 +02:00
parent 48a6fe1bd1
commit 9b72400839
4 changed files with 47 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=66 format=2]
[gd_scene load_steps=61 format=2]
[ext_resource path="res://Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Player/Player.png" type="Texture" id=2]
@@ -6,11 +6,6 @@
[ext_resource path="res://Overlap/HurtHit_Box/Hitbox.tscn" type="PackedScene" id=4]
[ext_resource path="res://Overlap/Stats/Stats.tscn" type="PackedScene" id=5]
[ext_resource path="res://Fonts/Harmonic/Harmonic.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://Player/Sounds/hero_walk_3.ogg" type="AudioStream" id=7]
[ext_resource path="res://Player/Sounds/hero_walk_5.ogg" type="AudioStream" id=8]
[ext_resource path="res://Player/Sounds/hero_walk_4.ogg" type="AudioStream" id=9]
[ext_resource path="res://Player/Sounds/hero_walk_2.ogg" type="AudioStream" id=10]
[ext_resource path="res://Player/Sounds/hero_walk_1.ogg" type="AudioStream" id=11]
[ext_resource path="res://Player/States/Idle.gd" type="Script" id=12]
[ext_resource path="res://Player/States/Run.gd" type="Script" id=13]
[ext_resource path="res://Player/States/Attack.gd" type="Script" id=14]
@@ -725,6 +720,8 @@ START_STATE = NodePath("Idle")
[node name="Run" type="Node" parent="AnimationStates"]
script = ExtResource( 13 )
SoundLibary = PoolStringArray( "res://Player/Sounds/hero_walk_1.ogg", "res://Player/Sounds/hero_walk_2.ogg", "res://Player/Sounds/hero_walk_3.ogg", "res://Player/Sounds/hero_walk_4.ogg", "res://Player/Sounds/hero_walk_5.ogg" )
Delay = 0.25
[node name="Idle" type="Node" parent="AnimationStates"]
script = ExtResource( 12 )
@@ -734,28 +731,6 @@ script = ExtResource( 14 )
[node name="Roll" type="Node" parent="AnimationStates"]
script = ExtResource( 16 )
[node name="Sounds" type="Node" parent="."]
[node name="Walk" type="Node" parent="Sounds"]
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="Sounds/Walk"]
stream = ExtResource( 11 )
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="Sounds/Walk"]
stream = ExtResource( 10 )
[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="Sounds/Walk"]
stream = ExtResource( 7 )
[node name="AudioStreamPlayer4" type="AudioStreamPlayer" parent="Sounds/Walk"]
stream = ExtResource( 9 )
[node name="AudioStreamPlayer5" type="AudioStreamPlayer" parent="Sounds/Walk"]
stream = ExtResource( 8 )
[node name="WalkSoundTimer" type="Timer" parent="Sounds"]
one_shot = true
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[connection signal="area_exited" from="Hurtbox" to="." method="_on_Hurtbox_area_exited"]