Files
BeastBound/scripts/game.gd
2024-10-26 13:59:50 +02:00

21 lines
365 B
GDScript

extends Node2D
func spawn_mob():
var new_mob = preload("res://scenes/enemy.tscn").instantiate()
%PathFollow2D.progress_ratio = randf()
new_mob.global_position = %PathFollow2D.global_position
add_child(new_mob)
func _on_timer_timeout() -> void:
spawn_mob()
func _on_player_health_depleted() -> void:
%GameOver.visible = true
get_tree().paused = true