Random enemy spawn
This commit is contained in:
15
scripts/game.gd
Normal file
15
scripts/game.gd
Normal 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()
|
Reference in New Issue
Block a user