diff --git a/TODO.md b/TODO.md index 3587aef..110cf19 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,4 @@ 1. Sound effects - * when a unit is killed * if possible, a small bit of background music 2. Gameplay additions: * powerups: change movement type, remove pawn's attack and movement restrictions diff --git a/assets/export/kill1.wav b/assets/export/kill1.wav new file mode 100644 index 0000000..b79cd54 Binary files /dev/null and b/assets/export/kill1.wav differ diff --git a/assets/export/kill2.wav b/assets/export/kill2.wav new file mode 100644 index 0000000..676a829 Binary files /dev/null and b/assets/export/kill2.wav differ diff --git a/assets/export/kill3.wav b/assets/export/kill3.wav new file mode 100644 index 0000000..7a7c916 Binary files /dev/null and b/assets/export/kill3.wav differ diff --git a/assets/export/kill4.wav b/assets/export/kill4.wav new file mode 100644 index 0000000..249da16 Binary files /dev/null and b/assets/export/kill4.wav differ diff --git a/assets/source/voice_clips.aup b/assets/source/voice_clips.aup index c45b6e7..29cddeb 100644 --- a/assets/source/voice_clips.aup +++ b/assets/source/voice_clips.aup @@ -1,6 +1,6 @@ - + @@ -35,6 +35,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -69,6 +101,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f21d.au b/assets/source/voice_clips_data/eff/d1f/eff1f21d.au new file mode 100644 index 0000000..f277066 Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f21d.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f37c.au b/assets/source/voice_clips_data/eff/d1f/eff1f37c.au new file mode 100644 index 0000000..308afeb Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f37c.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f727.au b/assets/source/voice_clips_data/eff/d1f/eff1f727.au new file mode 100644 index 0000000..58e3ee5 Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f727.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f7a0.au b/assets/source/voice_clips_data/eff/d1f/eff1f7a0.au new file mode 100644 index 0000000..88da62a Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f7a0.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f90d.au b/assets/source/voice_clips_data/eff/d1f/eff1f90d.au new file mode 100644 index 0000000..b68f00a Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f90d.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1f99f.au b/assets/source/voice_clips_data/eff/d1f/eff1f99f.au new file mode 100644 index 0000000..16e9156 Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1f99f.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1fea7.au b/assets/source/voice_clips_data/eff/d1f/eff1fea7.au new file mode 100644 index 0000000..8c9b419 Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1fea7.au differ diff --git a/assets/source/voice_clips_data/eff/d1f/eff1ff30.au b/assets/source/voice_clips_data/eff/d1f/eff1ff30.au new file mode 100644 index 0000000..e67229c Binary files /dev/null and b/assets/source/voice_clips_data/eff/d1f/eff1ff30.au differ diff --git a/src/Game.gd b/src/Game.gd index 6cf1841..1d17a37 100644 --- a/src/Game.gd +++ b/src/Game.gd @@ -62,6 +62,13 @@ const hit_sounds = [ "/root/Game/Hit4", ] +const KILL_SOUNDS = [ + "/root/Game/Kill1", + "/root/Game/Kill2", + "/root/Game/Kill3", + "/root/Game/Kill4", +] + func new_piece(piece_type, group, position = null): if not piece_types.has(piece_type): return null @@ -543,6 +550,9 @@ func _process(delta): if index_to_play != null: print("ai loss Chance to play: ", c, " got index ", index_to_play) get_node(self.on_player_lose_piece[index_to_play]).play() + else: + index_to_play = self.rng.randi() % self.KILL_SOUNDS.size() + get_node(self.KILL_SOUNDS[index_to_play]).play() else: # Deal damage target_square['piece'].health -= square['piece'].damage @@ -628,7 +638,6 @@ func _physics_process(delta): if dest_valid: var dest_square = self.board_squares[dest] if dest_square['piece'] != null: - # @TODO If the target doesn't die, we need to bounce back if square['piece'].damage >= dest_square['piece'].health: dest_square['piece'].queue_free() square['piece'].kills += 1 diff --git a/src/Game.tscn b/src/Game.tscn index 339c148..83bf914 100644 --- a/src/Game.tscn +++ b/src/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=30 format=2] [ext_resource path="res://src/Game.gd" type="Script" id=1] [ext_resource path="res://src/Playfield.tscn" type="PackedScene" id=2] @@ -22,6 +22,10 @@ [ext_resource path="res://assets/export/hit1.wav" type="AudioStream" id=20] [ext_resource path="res://assets/export/hit3.wav" type="AudioStream" id=21] [ext_resource path="res://assets/export/hit4.wav" type="AudioStream" id=22] +[ext_resource path="res://assets/export/kill2.wav" type="AudioStream" id=23] +[ext_resource path="res://assets/export/kill3.wav" type="AudioStream" id=24] +[ext_resource path="res://assets/export/kill4.wav" type="AudioStream" id=25] +[ext_resource path="res://assets/export/kill1.wav" type="AudioStream" id=26] [sub_resource type="DynamicFont" id=1] size = 24 @@ -251,6 +255,18 @@ stream = ExtResource( 21 ) [node name="Hit4" type="AudioStreamPlayer" parent="."] stream = ExtResource( 22 ) + +[node name="Kill1" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 26 ) + +[node name="Kill2" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 23 ) + +[node name="Kill3" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 24 ) + +[node name="Kill4" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 25 ) [connection signal="finished" from="EndSong" to="." method="_on_EndSong_finished"] [connection signal="finished" from="Yammering" to="." method="_on_Yammering_finished"] [connection signal="finished" from="Dust" to="." method="_on_Dust_finished"]