Skip to content

Commit

Permalink
✨ Add sfx to each items
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilienLeroy committed Nov 26, 2022
1 parent b7d163a commit 687eb69
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 8 deletions.
Binary file added assets/audios/bomb.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/audios/bomb.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/bomb.wav-55c9e434c8d20438ea0c6024cbdbc670.sample"

[deps]

source_file="res://assets/audios/bomb.wav"
dest_files=[ "res://.import/bomb.wav-55c9e434c8d20438ea0c6024cbdbc670.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=false
compress/mode=0
Binary file added assets/audios/lose.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/audios/lose.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/lose.wav-86a4073d84a0e97125c2f4526f04ace9.sample"

[deps]

source_file="res://assets/audios/lose.wav"
dest_files=[ "res://.import/lose.wav-86a4073d84a0e97125c2f4526f04ace9.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=false
compress/mode=0
Binary file added assets/audios/reset.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/audios/reset.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/reset.wav-2b605ad856031eab55f0800a951b7ad3.sample"

[deps]

source_file="res://assets/audios/reset.wav"
dest_files=[ "res://.import/reset.wav-2b605ad856031eab55f0800a951b7ad3.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=false
compress/mode=0
Binary file added assets/audios/restore.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/audios/restore.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/restore.wav-05f7e324de020ec900476cc44424c091.sample"

[deps]

source_file="res://assets/audios/restore.wav"
dest_files=[ "res://.import/restore.wav-05f7e324de020ec900476cc44424c091.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=false
compress/mode=0
Binary file added assets/audios/square.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/audios/square.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/square.wav-43d8c45bb23b1265ef9d07a72fc6cddb.sample"

[deps]

source_file="res://assets/audios/square.wav"
dest_files=[ "res://.import/square.wav-43d8c45bb23b1265ef9d07a72fc6cddb.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=false
compress/mode=0
9 changes: 7 additions & 2 deletions components/bomb.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://components/item.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/shaders/color.gdshader" type="Shader" id=2]
[ext_resource path="res://assets/icons/bomb.png" type="Texture" id=3]
[ext_resource path="res://components/bomb.gd" type="Script" id=4]
[ext_resource path="res://assets/audios/bomb.wav" type="AudioStream" id=5]

[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 2 )
Expand All @@ -12,6 +13,10 @@ shader_param/color = null
[node name="Bomb" instance=ExtResource( 1 )]
script = ExtResource( 4 )

[node name="Sprite" parent="." index="0"]
[node name="Sprite" parent="." index="1"]
material = SubResource( 1 )
texture = ExtResource( 3 )

[node name="Audio" parent="." index="4"]
stream = ExtResource( 5 )
volume_db = -5.0
1 change: 1 addition & 0 deletions components/item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func _on_input_event(viewport, event, shape_idx):
touch_under_zone = true;
emit_signal("touched_under_zone", self);
item_touched();
$Audio.play();

if (!get_is_multi()):
$Explosion.emit(null, get_touched_color());
Expand Down
2 changes: 2 additions & 0 deletions components/item.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ shape = SubResource( 1 )
anims/RESET = SubResource( 2 )
anims/fade = SubResource( 3 )
anims/touched = SubResource( 4 )

[node name="Audio" type="AudioStreamPlayer" parent="."]
9 changes: 7 additions & 2 deletions components/reset.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://components/item.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/icons/reset.png" type="Texture" id=2]
[ext_resource path="res://assets/shaders/color.gdshader" type="Shader" id=3]
[ext_resource path="res://components/reset.gd" type="Script" id=4]
[ext_resource path="res://assets/audios/reset.wav" type="AudioStream" id=5]

[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 3 )
Expand All @@ -12,6 +13,10 @@ shader_param/color = null
[node name="Item" instance=ExtResource( 1 )]
script = ExtResource( 4 )

[node name="Sprite" parent="." index="0"]
[node name="Sprite" parent="." index="1"]
material = SubResource( 1 )
texture = ExtResource( 2 )

[node name="Audio" parent="." index="4"]
stream = ExtResource( 5 )
volume_db = -10.0
9 changes: 7 additions & 2 deletions components/restore.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://components/item.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/icons/heart.png" type="Texture" id=2]
[ext_resource path="res://assets/shaders/color.gdshader" type="Shader" id=3]
[ext_resource path="res://components/restore.gd" type="Script" id=4]
[ext_resource path="res://assets/audios/restore.wav" type="AudioStream" id=5]

[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 3 )
Expand All @@ -12,6 +13,10 @@ shader_param/color = null
[node name="Restore" instance=ExtResource( 1 )]
script = ExtResource( 4 )

[node name="Sprite" parent="." index="0"]
[node name="Sprite" parent="." index="1"]
material = SubResource( 1 )
texture = ExtResource( 2 )

[node name="Audio" parent="." index="4"]
stream = ExtResource( 5 )
volume_db = -10.0
1 change: 1 addition & 0 deletions components/square.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func _on_exit_screen():
if (touch_under_zone):
return;

$AudioBomb.play();
emit_signal("loose_life");
pass;
12 changes: 11 additions & 1 deletion components/square.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=8 format=2]

[ext_resource path="res://assets/icons/Square.png" type="Texture" id=1]
[ext_resource path="res://components/item.tscn" type="PackedScene" id=2]
[ext_resource path="res://components/square.gd" type="Script" id=3]
[ext_resource path="res://assets/audios/square.wav" type="AudioStream" id=4]
[ext_resource path="res://assets/audios/bomb.wav" type="AudioStream" id=5]

[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
Expand All @@ -26,3 +28,11 @@ material = SubResource( 2 )
texture = ExtResource( 1 )

[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="." index="2"]

[node name="Audio" parent="." index="5"]
stream = ExtResource( 4 )
volume_db = -10.0

[node name="AudioBomb" type="AudioStreamPlayer2D" parent="." index="6"]
stream = ExtResource( 5 )
volume_db = -2.0
3 changes: 3 additions & 0 deletions main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func on_statistics():
update_current_view(create_statistics());

func on_lose(score, stats, save = false):
if (save):
$AudioLose.play();

update_current_view(create_lose(score, stats, save));

func on_save(score, stats):
Expand Down
8 changes: 7 additions & 1 deletion main.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://components/fade.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/audios/Odyssey – jiglr.mp3" type="AudioStream" id=2]
[ext_resource path="res://assets/audios/lose.wav" type="AudioStream" id=3]
[ext_resource path="res://main.gd" type="Script" id=4]

[node name="Main" type="Node2D"]
Expand All @@ -13,3 +14,8 @@ script = ExtResource( 4 )
stream = ExtResource( 2 )
volume_db = -15.0
autoplay = true

[node name="AudioLose" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 3 )
volume_db = -10.0
pitch_scale = 0.7

0 comments on commit 687eb69

Please sign in to comment.