game: add enemy taunt on death
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user