Sound effects

This commit is contained in:
Kienan Stewart 2022-04-03 12:10:15 -04:00
parent d22224a818
commit 399ab622a2
40 changed files with 313 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
build/
.import/
assets/export/*.import

View File

@ -10,9 +10,10 @@
* make the help text indicate (flash, etc.)
3. Sound effects
* on hit
* on piece lost
* on piece kill
* on opponent victory
* if possible, a small bit of background music
4. Further visual polish
5. New units
Bugs
* if the player has no possible moves, there is no way to continue: add a skip turn button

BIN
assets/export/dust.wav Normal file

Binary file not shown.

BIN
assets/export/end_song.ogg Normal file

Binary file not shown.

BIN
assets/export/hehe.wav Normal file

Binary file not shown.

BIN
assets/export/huh.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/export/stop_that.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/export/yammering.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,55 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="end_song_data" version="1.3.0" audacityversion="2.4.2" sel0="21.0604988662" sel1="21.2578684807" vpos="0" h="0.0000000000" zoom="86.1328125000" rate="44100.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="0" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="1199616">
<waveblock start="0">
<simpleblockfile filename="eff1f098.au" len="153600" min="-0.060289" max="0.088431" rms="0.029298"/>
</waveblock>
<waveblock start="153600">
<simpleblockfile filename="eff1ff48.au" len="262144" min="-0.147315" max="0.144434" rms="0.051524"/>
</waveblock>
<waveblock start="415744">
<simpleblockfile filename="eff1f07e.au" len="250368" min="-0.115696" max="0.126556" rms="0.05117"/>
</waveblock>
<waveblock start="666112">
<simpleblockfile filename="eff1f38c.au" len="262144" min="-0.134274" max="0.133188" rms="0.063226"/>
</waveblock>
<waveblock start="928256">
<simpleblockfile filename="eff1fe75.au" len="135680" min="-0.105051" max="0.097026" rms="0.039944"/>
</waveblock>
<waveblock start="1063936">
<simpleblockfile filename="eff1f367.au" len="135680" min="-0.099331" max="0.107399" rms="0.038117"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="0" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="1199616">
<waveblock start="0">
<simpleblockfile filename="eff1fbf8.au" len="153600" min="-0.061293" max="0.089902" rms="0.0298"/>
</waveblock>
<waveblock start="153600">
<simpleblockfile filename="eff1fa33.au" len="262144" min="-0.14984" max="0.146902" rms="0.052401"/>
</waveblock>
<waveblock start="415744">
<simpleblockfile filename="eff1fb3b.au" len="250368" min="-0.117691" max="0.128585" rms="0.052041"/>
</waveblock>
<waveblock start="666112">
<simpleblockfile filename="eff1faec.au" len="262144" min="-0.136569" max="0.135428" rms="0.064301"/>
</waveblock>
<waveblock start="928256">
<simpleblockfile filename="eff1f498.au" len="135680" min="-0.106823" max="0.098666" rms="0.041837"/>
</waveblock>
<waveblock start="1063936">
<simpleblockfile filename="eff1f6a7.au" len="135680" min="-0.101028" max="0.109236" rms="0.038755"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,147 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="voice_clips_data" version="1.3.0" audacityversion="2.4.2" sel0="0.0000000000" sel1="0.0000000000" vpos="0" h="30.8477097506" zoom="86.1328125000" rate="44100.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="Audio Track" isSelected="1" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0"/>
<wavetrack name="Audio Track" isSelected="1" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0"/>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="89600">
<waveblock start="0">
<simpleblockfile filename="eff1f454.au" len="89600" min="-0.329061" max="0.298501" rms="0.063693"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="89600">
<waveblock start="0">
<simpleblockfile filename="eff1f871.au" len="89600" min="-0.333327" max="0.299404" rms="0.064034"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="103424">
<waveblock start="0">
<simpleblockfile filename="eff1f349.au" len="103424" min="-0.582466" max="0.63643" rms="0.072722"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="103424">
<waveblock start="0">
<simpleblockfile filename="eff1f80e.au" len="103424" min="-0.582657" max="0.636347" rms="0.072825"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="127488">
<waveblock start="0">
<simpleblockfile filename="eff1f5f8.au" len="127488" min="-0.469669" max="0.442729" rms="0.069324"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="127488">
<waveblock start="0">
<simpleblockfile filename="eff1fabb.au" len="127488" min="-0.472139" max="0.445761" rms="0.069521"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="113152">
<waveblock start="0">
<simpleblockfile filename="eff1f7ea.au" len="113152" min="-0.453872" max="0.422228" rms="0.043192"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="113152">
<waveblock start="0">
<simpleblockfile filename="eff1f05b.au" len="113152" min="-0.453872" max="0.422228" rms="0.043192"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="31744">
<waveblock start="0">
<simpleblockfile filename="eff1fbaa.au" len="31744" min="-0.183495" max="0.183887" rms="0.026288"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="31744">
<waveblock start="0">
<simpleblockfile filename="eff1f19d.au" len="31744" min="-0.183495" max="0.183887" rms="0.026288"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="77824">
<waveblock start="0">
<simpleblockfile filename="eff1fb3a.au" len="77824" min="-0.180903" max="0.161589" rms="0.021131"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="1" solo="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="77824">
<waveblock start="0">
<simpleblockfile filename="eff1f750.au" len="77824" min="-0.181236" max="0.161845" rms="0.021138"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="0" linked="1" mute="0" solo="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="42496">
<waveblock start="0">
<simpleblockfile filename="eff1f701.au" len="42496" min="-0.278064" max="0.251917" rms="0.033554"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" isSelected="0" height="150" minimized="0" channel="1" linked="0" mute="0" solo="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="42496">
<waveblock start="0">
<simpleblockfile filename="eff1fd44.au" len="42496" min="-0.279366" max="0.252895" rms="0.03371"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -36,6 +36,15 @@ var reinforcements = null
var reinforcements_size = 0
var reinforcements_coords = []
const on_ai_lose_piece = {
50: "/root/Game/Huh",
75: "/root/Game/StopThat",
90: "/root/Game/Yammering",
}
const on_player_lose_piece = {
75: "/root/Game/Hehe",
90: "/root/Game/Dust",
}
const piece_types = {
"pawn": "res://src/pieces/Pawn.tscn",
"rook": "res://src/pieces/Rook.tscn",
@ -267,6 +276,7 @@ func _on_quit_game_pressed():
get_tree().quit()
func reset_game_state():
get_node("/root/Game/EndSong").stop()
self.is_player_turn = true
self.turn = 0
for p in get_tree().get_nodes_in_group("pieces"):
@ -405,6 +415,7 @@ func _on_new_turn():
self.reinforcements = 2 # 2 turns away
self.reinforcements_size = 4
get_node("BottomBar/Help").set_text("Multiple opponent reinforcements detected inbound")
get_node("/root/Game/ThinkYouCan").play()
self.flash_help = 3
if self.reinforcements == null and not just_spawned:
var chance = lerp(0, 50, 1 - float(opponent_pieces.size())/16.0)
@ -438,9 +449,11 @@ func _process(delta):
player_victory = true
get_node("/root/Game/TopBar/Bottom/Instruction").set_text("Game over")
if not player_victory:
get_node("/root/Game/EndSong").play()
get_node("/root/Game/BottomBar/Help").set_text("Unsurprisingly, the result was known before-hand.")
else:
get_node("/root/Game/BottomBar/Help").set_text("Well, I'll be damned. I didn't think this would happen!")
get_node("/root/Game/Impossible").play()
# Show a popup for new one, or quit
self._on_escape(true)
if self.current_state == 1:
@ -459,6 +472,15 @@ func _process(delta):
if target_square['piece'] != null:
# @TODO If the target doesn't die, we need to bounce back
target_square['piece'].queue_free()
var c = self.rng.randi() % 100
var index_to_play = null
for idx in self.on_player_lose_piece.keys():
if c < idx:
break
index_to_play = idx
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()
var square = square_of_piece(self.ai_piece)
square['piece'] = null
target_square['piece'] = self.ai_piece
@ -532,6 +554,15 @@ func _physics_process(delta):
if dest_square['piece'] != null:
# @TODO If the target doesn't die, we need to bounce back
dest_square['piece'].queue_free()
var c = self.rng.randi() % 100
var index_to_play = null
for idx in self.on_ai_lose_piece.keys():
if c < idx:
break
index_to_play = idx;
if index_to_play != null:
print("ai loss Chance to play: ", c, " got index ", index_to_play)
get_node(self.on_ai_lose_piece[index_to_play]).play()
square['piece'] = null
dest_square['piece'] = piece
piece.set_position(Vector2(dest_square['x']*128, dest_square['y']*128))
@ -545,3 +576,35 @@ func _physics_process(delta):
self.landing_piece = null
func _on_EndSong_finished():
get_node("/root/Game/EndSong").stop()
func _on_Yammering_finished():
get_node("/root/Game/Yammering").stop()
func _on_Dust_finished():
get_node("/root/Game/Dust").stop()
func _on_ThinkYouCan_finished():
get_node("/root/Game/ThinkYouCan").stop()
func _on_Impossible_finished():
get_node("/root/Game/Impossible").stop()
func _on_Hehe_finished():
get_node("/root/Game/Hehe").stop()
func _on_Huh_finished():
get_node("/root/Game/Huh").stop()
func _on_StopThat_finished():
get_node("/root/Game/StopThat").stop()

View File

@ -1,10 +1,18 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=15 format=2]
[ext_resource path="res://src/Game.gd" type="Script" id=1]
[ext_resource path="res://src/Playfield.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/large font.tres" type="DynamicFont" id=3]
[ext_resource path="res://assets/source/Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://src/EndMenu.tscn" type="PackedScene" id=5]
[ext_resource path="res://assets/export/end_song.ogg" type="AudioStream" id=6]
[ext_resource path="res://assets/export/impossible.wav" type="AudioStream" id=7]
[ext_resource path="res://assets/export/thinkyoucan.wav" type="AudioStream" id=8]
[ext_resource path="res://assets/export/yammering.wav" type="AudioStream" id=9]
[ext_resource path="res://assets/export/stop_that.wav" type="AudioStream" id=10]
[ext_resource path="res://assets/export/huh.wav" type="AudioStream" id=11]
[ext_resource path="res://assets/export/dust.wav" type="AudioStream" id=12]
[ext_resource path="res://assets/export/hehe.wav" type="AudioStream" id=13]
[sub_resource type="DynamicFont" id=1]
size = 24
@ -98,3 +106,37 @@ valign = 1
[node name="EndMenu" parent="." instance=ExtResource( 5 )]
visible = true
[node name="EndSong" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 6 )
volume_db = 4.0
autoplay = true
[node name="Yammering" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
[node name="Dust" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 12 )
[node name="ThinkYouCan" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
[node name="Impossible" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 7 )
[node name="Hehe" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 13 )
[node name="Huh" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 11 )
[node name="StopThat" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 10 )
[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"]
[connection signal="finished" from="ThinkYouCan" to="." method="_on_ThinkYouCan_finished"]
[connection signal="finished" from="Impossible" to="." method="_on_Impossible_finished"]
[connection signal="finished" from="Hehe" to="." method="_on_Hehe_finished"]
[connection signal="finished" from="Huh" to="." method="_on_Huh_finished"]
[connection signal="finished" from="StopThat" to="." method="_on_StopThat_finished"]