Random enemy spawn

This commit is contained in:
2024-10-26 13:51:02 +02:00
parent 40b841e7af
commit 2e2e0c4468
6 changed files with 56 additions and 84 deletions

15
scripts/game.gd Normal file
View File

@ -0,0 +1,15 @@
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()