summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 13:20:01 -0300
committerVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 13:23:46 -0300
commit379205c19719b7b91ac518edc3cf3603cc21f233 (patch)
tree60ff9c301610bb040704ba48a1888f02c26c235a
parentd82ead0125167f3288804dc19cafd40c17bd05d8 (diff)
downloadgamejam-gmtk-2022-379205c19719b7b91ac518edc3cf3603cc21f233.tar.gz
gamejam-gmtk-2022-379205c19719b7b91ac518edc3cf3603cc21f233.tar.bz2
gamejam-gmtk-2022-379205c19719b7b91ac518edc3cf3603cc21f233.zip
Add damage sfx
-rw-r--r--Assets/Sound/damage.wavbin0 -> 67308 bytes
-rw-r--r--Assets/Sound/damage.wav.import21
-rw-r--r--Scenes/Dungeon.gd12
-rw-r--r--Scenes/PlateDamage.gd2
-rw-r--r--Scenes/Player.gd4
-rw-r--r--Scenes/Player.tscn7
-rw-r--r--Scenes/Transition.tscn29
7 files changed, 58 insertions, 17 deletions
diff --git a/Assets/Sound/damage.wav b/Assets/Sound/damage.wav
new file mode 100644
index 0000000..5721904
--- /dev/null
+++ b/Assets/Sound/damage.wav
Binary files differ
diff --git a/Assets/Sound/damage.wav.import b/Assets/Sound/damage.wav.import
new file mode 100644
index 0000000..61e1bea
--- /dev/null
+++ b/Assets/Sound/damage.wav.import
@@ -0,0 +1,21 @@
+[remap]
+
+importer="wav"
+type="AudioStreamSample"
+path="res://.import/damage.wav-0ef5b966ce05860528d54f5936ae0651.sample"
+
+[deps]
+
+source_file="res://Assets/Sound/damage.wav"
+dest_files=[ "res://.import/damage.wav-0ef5b966ce05860528d54f5936ae0651.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
diff --git a/Scenes/Dungeon.gd b/Scenes/Dungeon.gd
index 6ea8ad0..9293120 100644
--- a/Scenes/Dungeon.gd
+++ b/Scenes/Dungeon.gd
@@ -23,7 +23,7 @@ var tiles_floor = {}
func _ready():
randomize()
build_floor()
-
+
Global.active_crystals = 0
Global.max_crystals = get_tree().get_nodes_in_group("crystals").size()
@@ -35,11 +35,11 @@ func intro_animation():
$UIController.hand_animation()
yield(get_tree().create_timer(1.1), "timeout")
player.show()
-
+
if Global.onboarding:
yield($UIController.on_onboarding(), "completed")
Global.onboarding = false
-
+
block_input = false
func end_animation():
@@ -81,7 +81,7 @@ func build_floor():
func _process(delta):
if block_input: return
-
+
var actionables = get_tree().get_nodes_in_group("actionables")
var idle = true
@@ -149,7 +149,7 @@ func process_turn_logic():
Monster.MonsterActionType.IDLE:
pass
Monster.MonsterActionType.ATTACK:
- player.add_action("cor_shake", [0.2])
+ player.add_action("cor_damage", [0.2])
Global.turns -= 1
Monster.MonsterActionType.MOVE:
move_entity(monster, monster_action.dir)
@@ -167,7 +167,7 @@ func process_turn_logic():
func _input(event):
if block_input: return
-
+
if input != Vector2.ZERO:
return
diff --git a/Scenes/PlateDamage.gd b/Scenes/PlateDamage.gd
index d910f76..76601b9 100644
--- a/Scenes/PlateDamage.gd
+++ b/Scenes/PlateDamage.gd
@@ -2,7 +2,7 @@ extends Plate
func activate(entity : Entity, dungeon):
if entity is Player:
- entity.add_action("cor_shake", [0.2])
+ entity.add_action("cor_damage", [0.2])
Global.turns -= int(entity.get_top())
return
diff --git a/Scenes/Player.gd b/Scenes/Player.gd
index 0e05204..7ffb1dd 100644
--- a/Scenes/Player.gd
+++ b/Scenes/Player.gd
@@ -154,3 +154,7 @@ func cor_shake(args : Array):
break
yield(get_tree(), "idle_frame")
+
+func cor_damage(args : Array):
+ $Damage.play()
+ yield(cor_shake(args), "completed")
diff --git a/Scenes/Player.tscn b/Scenes/Player.tscn
index da12e00..b4da183 100644
--- a/Scenes/Player.tscn
+++ b/Scenes/Player.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=15 format=2]
+[gd_scene load_steps=16 format=2]
[ext_resource path="res://Scenes/Player.gd" type="Script" id=1]
[ext_resource path="res://Assets/2_dots_blue.png" type="Texture" id=2]
@@ -8,6 +8,7 @@
[ext_resource path="res://Assets/4_dots.png" type="Texture" id=6]
[ext_resource path="res://Assets/Sound/dice_moving.wav" type="AudioStream" id=7]
[ext_resource path="res://Assets/6_dots.png" type="Texture" id=8]
+[ext_resource path="res://Assets/Sound/damage.wav" type="AudioStream" id=9]
[sub_resource type="QuadMesh" id=5]
@@ -70,3 +71,7 @@ material/0 = SubResource( 10 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 7 )
pitch_scale = 2.93
+
+[node name="Damage" type="AudioStreamPlayer" parent="."]
+stream = ExtResource( 9 )
+volume_db = -10.0
diff --git a/Scenes/Transition.tscn b/Scenes/Transition.tscn
index d3cac4c..8c7589d 100644
--- a/Scenes/Transition.tscn
+++ b/Scenes/Transition.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=32 format=2]
+[gd_scene load_steps=35 format=2]
[ext_resource path="res://Assets/transition.png" type="Texture" id=1]
[ext_resource path="res://Scenes/CameraControl.gd" type="Script" id=2]
@@ -7,7 +7,6 @@
[ext_resource path="res://Assets/AlegreyaSansSC-ExtraBold.ttf" type="DynamicFontData" id=5]
[ext_resource path="res://Assets/exp.png" type="Texture" id=6]
[ext_resource path="res://Assets/arm.png" type="Texture" id=7]
-[ext_resource path="res://Assets/3_dots.png" type="Texture" id=8]
[ext_resource path="res://Assets/DiceFaceMaterial.tres" type="Material" id=9]
[ext_resource path="res://Assets/6_dots.png" type="Texture" id=10]
[ext_resource path="res://Assets/5_dots.png" type="Texture" id=11]
@@ -28,15 +27,27 @@ albedo_texture = ExtResource( 15 )
[sub_resource type="SpatialMaterial" id=8]
albedo_texture = ExtResource( 11 )
-[sub_resource type="SpatialMaterial" id=9]
-albedo_texture = ExtResource( 8 )
+[sub_resource type="SpatialMaterial" id=20]
+albedo_texture = ExtResource( 12 )
[sub_resource type="SpatialMaterial" id=10]
albedo_texture = ExtResource( 13 )
+[sub_resource type="SpatialMaterial" id=21]
+albedo_texture = ExtResource( 12 )
+
[sub_resource type="SpatialMaterial" id=19]
albedo_texture = ExtResource( 12 )
+[sub_resource type="SpatialMaterial" id=22]
+albedo_texture = ExtResource( 12 )
+
+[sub_resource type="SpatialMaterial" id=23]
+albedo_texture = ExtResource( 12 )
+
+[sub_resource type="SpatialMaterial" id=24]
+albedo_texture = ExtResource( 12 )
+
[sub_resource type="DynamicFont" id=11]
size = 80
font_data = ExtResource( 5 )
@@ -312,7 +323,7 @@ material/0 = SubResource( 8 )
[node name="FaceForward" type="MeshInstance" parent="Mesh"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 )
mesh = SubResource( 5 )
-material/0 = SubResource( 9 )
+material/0 = SubResource( 20 )
[node name="FaceBackward" type="MeshInstance" parent="Mesh"]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 )
@@ -347,7 +358,7 @@ material/0 = SubResource( 8 )
[node name="FaceForward" type="MeshInstance" parent="Mesh2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 )
mesh = SubResource( 5 )
-material/0 = SubResource( 9 )
+material/0 = SubResource( 21 )
[node name="FaceBackward" type="MeshInstance" parent="Mesh2"]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 )
@@ -417,7 +428,7 @@ material/0 = SubResource( 8 )
[node name="FaceForward" type="MeshInstance" parent="Mesh4"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 )
mesh = SubResource( 5 )
-material/0 = SubResource( 9 )
+material/0 = SubResource( 22 )
[node name="FaceBackward" type="MeshInstance" parent="Mesh4"]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 )
@@ -452,7 +463,7 @@ material/0 = SubResource( 8 )
[node name="FaceForward" type="MeshInstance" parent="Mesh5"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 )
mesh = SubResource( 5 )
-material/0 = SubResource( 9 )
+material/0 = SubResource( 23 )
[node name="FaceBackward" type="MeshInstance" parent="Mesh5"]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 )
@@ -487,7 +498,7 @@ material/0 = SubResource( 8 )
[node name="FaceForward" type="MeshInstance" parent="Mesh6"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 )
mesh = SubResource( 5 )
-material/0 = SubResource( 9 )
+material/0 = SubResource( 24 )
[node name="FaceBackward" type="MeshInstance" parent="Mesh6"]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 )