game: add enemy taunt on death

This commit is contained in:
2025-08-19 08:39:50 +02:00
parent a661c02e83
commit 59a8a4a8f3
4 changed files with 104 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ var enemy_scene = preload("res://scenes/enemies/enemy.tscn")
func _ready() -> void:
timer.wait_time = spawn_rate / 1
timer.start()
GlobalConst.sig_stop_spawning.connect(_on_stop_spawning)
func _on_timer_timeout() -> void:
@@ -22,3 +23,9 @@ func _on_timer_timeout() -> void:
new_enemy.position = target.position + Vector2(50, 50)
new_enemy.target = target
add_child(new_enemy)
func _on_stop_spawning(val: bool):
if val:
timer.stop()
elif timer.is_stopped():
timer.start()