summaryrefslogtreecommitdiff
path: root/scripts/game_data.gd
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-25 02:21:43 -0400
committerbd <bdunahu@operationnull.com>2025-05-25 02:21:43 -0400
commit4e956f8f242eea5c52fb3f6bb6190494e55a7e79 (patch)
treeac4dbfd80d504c97a51a81ce1efed9cac845ef72 /scripts/game_data.gd
parent15724430070a17ffb4e0fe3a0c3faa8c82fe64e2 (diff)
Add noise when losing morale, game over background
Diffstat (limited to 'scripts/game_data.gd')
-rw-r--r--scripts/game_data.gd5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/game_data.gd b/scripts/game_data.gd
index f03eaa7..6850b35 100644
--- a/scripts/game_data.gd
+++ b/scripts/game_data.gd
@@ -1,6 +1,7 @@
extends Node
var game_stats_config = preload("res://resources/game_stats_config.tres")
+var morale_down = preload("res://assets/morale_down.wav")
signal life_changed
signal morale_changed
@@ -36,6 +37,10 @@ func subtract_morale(amount: int):
emit_signal("morale_changed")
if (_morale < 1):
get_tree().change_scene_to_file("res://scenes/game_over.tscn")
+ else:
+ var ap = get_tree().current_scene.get_node("Blips")
+ ap.stream = morale_down
+ ap.play()
func get_current_wave() -> int:
return _current_wave