Add sound effects for player actions and collectables

This commit is contained in:
2025-04-26 02:15:23 +02:00
parent 8959fd4b9f
commit f01645c094
46 changed files with 897 additions and 1058 deletions

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://bargnp4twtmxg"]
[gd_scene load_steps=7 format=3 uid="uid://bargnp4twtmxg"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_aya2w"]
[ext_resource type="Script" path="res://scripts/components/collectable.gd" id="2_7cph7"]
[ext_resource type="Resource" uid="uid://bsnr5v2b2mfsl" path="res://resources/collectables/big_coin.tres" id="3_lk3av"]
[ext_resource type="Script" path="res://scripts/components/fade_away.gd" id="4_wkrj0"]
[ext_resource type="AudioStream" uid="uid://bceic1csr8rq3" path="res://sfx/pickup_coin_2.wav" id="5_dbffd"]
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
@@ -22,10 +23,11 @@ hframes = 12
vframes = 12
frame = 51
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d") groups=["coins"]]
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d", "sfx") groups=["coins"]]
script = ExtResource("2_7cph7")
area2d = NodePath("..")
collectable_data = ExtResource("3_lk3av")
sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("sprite2d", "root", "area2d")]
script = ExtResource("4_wkrj0")
@@ -33,3 +35,7 @@ sprite2d = NodePath("../Sprite2D")
fade_duration = 0.4
root = NodePath("..")
area2d = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_dbffd")
volume_db = -5.0

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://d08dfqmirnd66"]
[gd_scene load_steps=7 format=3 uid="uid://d08dfqmirnd66"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_1co1x"]
[ext_resource type="Script" path="res://scripts/components/collectable.gd" id="2_cujcq"]
[ext_resource type="Resource" uid="uid://b6xqotmke54x" path="res://resources/collectables/big_treasure.tres" id="3_k64cr"]
[ext_resource type="Script" path="res://scripts/components/fade_away.gd" id="4_nw7tw"]
[ext_resource type="AudioStream" uid="uid://wr7n5ivv06ux" path="res://sfx/pickup_coin_4.wav" id="5_fxf8v"]
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
@@ -21,10 +22,11 @@ hframes = 12
vframes = 12
frame = 64
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d") groups=["coins"]]
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d", "sfx") groups=["coins"]]
script = ExtResource("2_cujcq")
area2d = NodePath("..")
collectable_data = ExtResource("3_k64cr")
sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("sprite2d", "root", "area2d")]
script = ExtResource("4_nw7tw")
@@ -32,3 +34,6 @@ sprite2d = NodePath("../Sprite2D")
fade_duration = 0.4
root = NodePath("..")
area2d = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_fxf8v")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://bqi5s710xb1ju"]
[gd_scene load_steps=24 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_8j4h4"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="2_bc55y"]
@@ -17,6 +17,9 @@
[ext_resource type="Script" path="res://scripts/components/magnetic_skill.gd" id="15_4df3h"]
[ext_resource type="Script" path="res://scripts/components/can_be_launched_component.gd" id="16_kemlv"]
[ext_resource type="Script" path="res://scripts/components/trigger_lever_component.gd" id="17_hglfj"]
[ext_resource type="AudioStream" uid="uid://duj2q0rqytaxg" path="res://sfx/jump.wav" id="18_pysae"]
[ext_resource type="AudioStream" uid="uid://bmfn6p88gy575" path="res://sfx/player_hurt.wav" id="19_7anly"]
[ext_resource type="AudioStream" uid="uid://ycgtf6wj7mto" path="res://sfx/heal.wav" id="20_bptj5"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hdsg1"]
size = Vector2(16, 31)
@@ -27,10 +30,11 @@ size = Vector2(16, 32)
[sub_resource type="CircleShape2D" id="CircleShape2D_ps31c"]
radius = 48.0
[node name="Brick Player" type="CharacterBody2D"]
[node name="Brick Player" type="CharacterBody2D" node_paths=PackedStringArray("jump_sfx")]
collision_layer = 4
collision_mask = 43
script = ExtResource("1_8j4h4")
jump_sfx = NodePath("sfx_jump")
[node name="Root" type="Node2D" parent="."]
@@ -72,8 +76,10 @@ shape = SubResource("RectangleShape2D_vad0t")
[node name="ScoreComponent" type="Node" parent="."]
script = ExtResource("6_fowa2")
[node name="HealthComponent" type="Node" parent="."]
[node name="HealthComponent" type="Node" parent="." node_paths=PackedStringArray("hurt_fx", "heal_fx")]
script = ExtResource("7_tqjk8")
hurt_fx = NodePath("../sfx_hurt")
heal_fx = NodePath("../sfx_heal")
[node name="PlayerDeathComponent" type="Node" parent="."]
process_mode = 3
@@ -140,5 +146,14 @@ script = ExtResource("16_kemlv")
[node name="TriggerLeverComponent" type="Node" parent="."]
script = ExtResource("17_hglfj")
[node name="sfx_jump" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("18_pysae")
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("19_7anly")
[node name="sfx_heal" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("20_bptj5")
[connection signal="on_death" from="HealthComponent" to="PlayerDeathComponent" method="_on_health_component_on_death"]
[connection signal="on_health_change" from="HealthComponent" to="KnockbackComponent" method="_on_health_component_on_health_change"]

51
objects/child.tscn Normal file
View File

@@ -0,0 +1,51 @@
[gd_scene load_steps=9 format=3 uid="uid://d0s2abysa86rq"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="1_jcisc"]
[ext_resource type="Texture2D" uid="uid://jl1gwqchhpdc" path="res://sprites/left_eye.png" id="2_8jrbi"]
[ext_resource type="Texture2D" uid="uid://iiawtnwmeny3" path="res://sprites/right_eye.png" id="3_k41y7"]
[ext_resource type="Texture2D" uid="uid://8h05rd26t66q" path="res://sprites/lollipop.png" id="4_vq1oq"]
[ext_resource type="Script" path="res://scripts/components/collectable.gd" id="5_wc3ym"]
[ext_resource type="Resource" uid="uid://b6apusc0jmi3x" path="res://resources/collectables/child.tres" id="6_vmvuo"]
[ext_resource type="AudioStream" uid="uid://drfr0wlgkhkdq" path="res://sfx/child_pickup.wav" id="7_j8eyh"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj5g5"]
size = Vector2(10, 20)
[node name="Child" type="Area2D"]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_dj5g5")
[node name="Root" type="Node2D" parent="."]
[node name="Body" type="Node2D" parent="Root"]
scale = Vector2(0.5, 0.5)
[node name="Base" type="Sprite2D" parent="Root/Body"]
texture = ExtResource("1_jcisc")
[node name="Left Eye" type="Sprite2D" parent="Root/Body"]
position = Vector2(-7, -6)
texture = ExtResource("2_8jrbi")
hframes = 2
[node name="Right Eye" type="Sprite2D" parent="Root/Body"]
position = Vector2(6, -5)
texture = ExtResource("3_k41y7")
hframes = 2
[node name="Sprite2D" type="Sprite2D" parent="Root"]
position = Vector2(6, 1)
rotation = 0.785398
texture = ExtResource("4_vq1oq")
[node name="CollectableComponent" type="Node" parent="." node_paths=PackedStringArray("area2d", "sfx")]
script = ExtResource("5_wc3ym")
area2d = NodePath("..")
collectable_data = ExtResource("6_vmvuo")
sfx = NodePath("../sfx_pickup")
[node name="sfx_pickup" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("7_j8eyh")

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://54w4wisfj8v8"]
[gd_scene load_steps=7 format=3 uid="uid://54w4wisfj8v8"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_epuj5"]
[ext_resource type="Script" path="res://scripts/components/collectable.gd" id="2_y0k47"]
[ext_resource type="Resource" uid="uid://vql535ckoeqm" path="res://resources/collectables/coin.tres" id="3_fm2fq"]
[ext_resource type="Script" path="res://scripts/components/fade_away.gd" id="4_fx1h2"]
[ext_resource type="AudioStream" uid="uid://dpyr80hk4kebc" path="res://sfx/pickup_coin_1.wav" id="5_4jc2c"]
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
@@ -21,10 +22,11 @@ hframes = 12
vframes = 12
frame = 51
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d") groups=["coins"]]
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d", "sfx") groups=["coins"]]
script = ExtResource("2_y0k47")
area2d = NodePath("..")
collectable_data = ExtResource("3_fm2fq")
sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("sprite2d", "root", "area2d")]
script = ExtResource("4_fx1h2")
@@ -32,3 +34,7 @@ sprite2d = NodePath("../Sprite2D")
fade_duration = 0.4
root = NodePath("..")
area2d = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_4jc2c")
volume_db = -5.0

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://bwdlmualj6xbw"]
[gd_scene load_steps=18 format=3 uid="uid://bwdlmualj6xbw"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_ep4yr"]
[ext_resource type="Texture2D" uid="uid://xes6mt2dd5gu" path="res://sprites/robot_cutout.png" id="1_uh38l"]
@@ -12,6 +12,8 @@
[ext_resource type="Script" path="res://scripts/components/status_effect_component.gd" id="10_5i27q"]
[ext_resource type="Script" path="res://scripts/components/fire_effect_component.gd" id="10_ej8vg"]
[ext_resource type="Script" path="res://scripts/components/ice_effect_component.gd" id="11_pq0k7"]
[ext_resource type="AudioStream" uid="uid://b3tsqhr06pbrs" path="res://sfx/enemy_hurt.wav" id="13_u4k3d"]
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="14_tdjks"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(18, 27)
@@ -35,8 +37,9 @@ shape = SubResource("RectangleShape2D_pwwji")
material = SubResource("ShaderMaterial_j18j0")
texture = ExtResource("1_uh38l")
[node name="HealthComponent" type="Node" parent="."]
[node name="HealthComponent" type="Node" parent="." node_paths=PackedStringArray("hurt_fx")]
script = ExtResource("2_o170m")
hurt_fx = NodePath("../sfx_hurt")
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
script = ExtResource("4_4eajk")
@@ -105,3 +108,9 @@ root = NodePath("..")
script = ExtResource("11_pq0k7")
components_to_disable = [NodePath("../SideToSideMovement"), NodePath("../PeriodicShootingComponent")]
status_effect_component = NodePath("../StatusEffectComponent")
[node name="sfx_hurt" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("13_u4k3d")
[node name="sfx_shoot" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("14_tdjks")

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://073ts5cxtwbl"]
[gd_scene load_steps=7 format=3 uid="uid://073ts5cxtwbl"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_uh3ex"]
[ext_resource type="Script" path="res://scripts/components/collectable.gd" id="2_i1ssp"]
[ext_resource type="Resource" uid="uid://bws2xldndlre1" path="res://resources/collectables/treasure.tres" id="3_uknsr"]
[ext_resource type="Script" path="res://scripts/components/fade_away.gd" id="4_ccbcr"]
[ext_resource type="AudioStream" uid="uid://d2rj7uy5f0kwm" path="res://sfx/pickup_coin_3.wav" id="5_xt2rk"]
[sub_resource type="CircleShape2D" id="CircleShape2D_3ask2"]
radius = 9.0
@@ -21,10 +22,11 @@ hframes = 12
vframes = 12
frame = 66
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d") groups=["coins"]]
[node name="Collectable" type="Node" parent="." node_paths=PackedStringArray("area2d", "sfx") groups=["coins"]]
script = ExtResource("2_i1ssp")
area2d = NodePath("..")
collectable_data = ExtResource("3_uknsr")
sfx = NodePath("../sfx")
[node name="FadeAwayComponent" type="Node" parent="." node_paths=PackedStringArray("sprite2d", "root", "area2d")]
script = ExtResource("4_ccbcr")
@@ -32,3 +34,7 @@ sprite2d = NodePath("../Sprite2D")
fade_duration = 0.4
root = NodePath("..")
area2d = NodePath("..")
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_xt2rk")
volume_db = -5.0